Visual Studio Code Distilled: Evolved Code Editing For Windows, Macos, and Linux 1St Edition Alessandro Del Sole
Visual Studio Code Distilled: Evolved Code Editing For Windows, Macos, and Linux 1St Edition Alessandro Del Sole
com
https://textbookfull.com/product/visual-studio-code-
distilled-evolved-code-editing-for-windows-macos-and-
linux-1st-edition-alessandro-del-sole/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/beginning-visual-studio-for-mac-
build-cross-platform-apps-with-xamarin-and-net-core-alessandro-del-
sole/
textbookfull.com
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/
textbookfull.com
https://textbookfull.com/product/visual-studio-code-end-to-end-
editing-and-debugging-tools-for-web-developers-bruce-johnson/
textbookfull.com
Visual Studio Extensibility Development: Extending Visual
Studio IDE for Productivity, Quality, Tooling, and
Analysis Rishabh Verma
https://textbookfull.com/product/visual-studio-extensibility-
development-extending-visual-studio-ide-for-productivity-quality-
tooling-and-analysis-rishabh-verma/
textbookfull.com
https://textbookfull.com/product/2018-international-building-code-1st-
edition-international-code-council/
textbookfull.com
https://textbookfull.com/product/the-code-breaker-jennifer-doudna-
gene-editing-the-future-of-the-human-race-1st-edition-walter-isaacson/
textbookfull.com
https://textbookfull.com/product/international-building-
code-2018-2018th-edition-international-code-council/
textbookfull.com
Visual Studio
Code Distilled
Evolved Code Editing for Windows,
macOS, and Linux
—
Alessandro Del Sole
Visual Studio Code
Distilled
Evolved Code Editing for
Windows, macOS, and Linux
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
Managing Breakpoints��������������������������������������������������������������������������������202
Debugging an Application����������������������������������������������������������������������������203
Supporting Azure, Docker, and Artificial Intelligence�����������������������������������������207
Summary����������������������������������������������������������������������������������������������������������209
Index�������������������������������������������������������������������������������������������������211
x
About the Author
Alessandro Del Sole is Senior Software Engineer for a healthcare company,
building mobile apps for doctors and dialysis patients. He has been in the
software industry for almost 20 years, focusing on Microsoft technologies
such as .NET, C#, Visual Studio, and Xamarin. He has been a trainer,
consultant, and a Microsoft MVP since 2008 and is the author of many
technical books. He is a Xamarin Certified Mobile Developer, Microsoft
Certified Professional, and a Microsoft Programming Specialist in C#.
xi
Acknowledgments
Thanks to Joan Murray, Jill Balzano, Laura Berendson and to everyone at
Apress for the opportunity and the great teamwork on this book.
Special thanks to the technical editor, Dr. James McCaffrey, who
contributed to the quality and accuracy of the contents.
Special thanks to my girlfriend Angelica, who understands and never
complains about the time I spend on writing books.
xiii
Introduction
One of the most common requirements in software development today
is building applications and services that run on multiple systems and
devices, especially with the continued expansion of cloud and artificial
intelligence services.
Developers have many options to build cross-platform and cross-
device software, from languages to development platforms and
tools. However, in most cases such tools rely on proprietary systems,
therefore creating strong dependencies. Moreover, most development
tools target specific platforms and development scenarios. Microsoft
Visual Studio Code makes a step forward, by providing a fully featured
development environment for Windows, macOS, and Linux that not
only offers advanced coding features but also integrated tools that span
across the entire application lifecycle from coding to debugging to team
collaboration. In this book, developers with any skill will learn how to
leverage Visual Studio Code to target scenarios such as web, cloud, and
mobile development with the programming language of their choice,
providing guidance to build apps for any system and any device.
xv
CHAPTER 1
Introducing Visual
Studio Code
Visual Studio Code is not just another evolved notepad with syntax
colorization and automatic indentation. Instead, it is a very powerful
code-focused development environment expressly designed to make
it easier to write web, mobile, and cloud applications using languages
that are available to different development platforms and to support
the application development lifecycle with a built-in debugger and with
integrated support to the popular Git version control engine.
With Visual Studio Code, you can work with individual code files or
with structured file systems based on folders. This chapter provides an
introduction to Visual Studio Code giving you information on when and
why you should use it, as well as about installing and configuring the
program on the different supported operating systems.
Note Across the book, I will refer to the product with its full
name, Visual Studio Code, and its friendly names VS Code and Code
interchangeably.
2
Chapter 1 Introducing Visual Studio Code
3
Chapter 1 Introducing Visual Studio Code
In order to properly combine all these features into one tool, Visual
Studio Code provides a coding environment based on folders, which
makes it easy to work with code files that are not organized within projects
and offers a unified way to work with different languages. Starting from
this assumption, Code offers an advanced editing experience with features
that are common to any supported languages, plus some features that are
available to specific languages. As you learn throughout the book, Code
also makes it easy to extend its built-in features by supplying custom
languages, syntax coloring, editing tools, debuggers, and much more via
a number of extensibility points. It is a code-centric tool, with primary
focus on web, cross-platform code. That said, it does not provide all of the
features you need for full, more complex application development and
application lifecycle management and is not intended to be the proper
choice with some development platforms. If you have to make a choice,
consider the following points:
• Visual Studio Code can produce binaries and
executable files only if the language you use has
support to do so through a debugger. If you use a
language for which there is no extensive support (e.g.,
Visual Basic), Visual Studio Code is not able to invoke
a compiler. You can workaround this by implementing
task automation, discussed in Chapter 8, "Automating
Tasks," but this is different than having the compilation
process integrated.
4
Chapter 1 Introducing Visual Studio Code
5
Chapter 1 Introducing Visual Studio Code
In the next paragraphs, you will learn tips for installing Code on the
various supported systems.
6
Chapter 1 Introducing Visual Studio Code
users. The second installer makes Code available only to the currently
logged user, but it does not require administrative privileges.
The latter is the choice I recommend, especially if you work within a
corporate environment and you do not have administrative privileges to
install software on your PC. The Download for Windows button that you
can see in Figure 1-1 will automatically download the global installer. If
you instead wish to download the user-level installer, click the arrow at the
right of the button and then click the User Installer hyperlink. It is worth
mentioning that Visual Studio Code is available in two versions, 32 bit
and 64 bit. The download page will automatically suggest the version that
matches your operating system architecture, but if you wish to download a
different installer, you can click the arrow and then click Other downloads.
Once the download has been completed, launch the installer and
simply follow the guided procedure as you are already used to do with
most of Windows programs. During the installation, you will be prompted
to specify how you want to integrate shortcuts to Visual Studio Code in the
Windows’ shell. In the Select Additional Tasks dialog, make sure you select
(at least) the following options:
7
Chapter 1 Introducing Visual Studio Code
A specific dialog will inform you once the installation process has
completed. The installation folder for the user-level installer is C:\
Users\proga\AppData\Local\Programs\Microsoft VS Code, while the
installation folder for the global installer is C:\Program Files\Microsoft
VS Code on 64-bit systems and C:\Program Files(x86)\Microsoft VS
Code on 32-bit systems. You will find a shortcut to Visual Studio Code in
the Start menu and on the Desktop, if you selected the option to create
a shortcut during the installation. When started, Visual Studio Code
appears like in Figure 1-2.
8
Chapter 1 Introducing Visual Studio Code
9
Chapter 1 Introducing Visual Studio Code
10
Chapter 1 Introducing Visual Studio Code
Note If you are a Windows user and want to try Visual Studio Code
on a Linux distribution, you can create a virtual machine with the
Hyper-V tool. For example, you might install the latest Ubuntu version
(www.ubuntu.com/download/desktop) as an ISO image and
use it as an installation media in Hyper-V. On macOS, you need to
purchase the Apple Parallels Desktop software separately in order to
create virtual machines, but you can basically do the same.
11
Chapter 1 Introducing Visual Studio Code
L ocalization Support
Visual Studio Code ships in English, but it can be localized in many other
supported languages and cultures. When started, VS Code checks for the
operating system language and, if different from English, it shows a popup
suggesting to install a language pack for the culture of your operating
system. The localization support can be also enabled manually.
To accomplish this, select View ➤ Command Palette. When the text
box appears at the top of the page, type the following command:
This will open a file called locale.json, which is the place where Visual
Studio Code stores the localization information. Figure 1-5 shows how this
file appears in the editor. As you can see in the comments, there is a link to
the documentation that contains the full list of supported cultures.
12
Chapter 1 Introducing Visual Studio Code
Additionally, you can manually check for updates with Help ➤ Check
for Updates on Windows and Linux and with Code ➤ Check for Updates
on macOS. If you do not want to receive automatic updates and prefer
manual updates, you can disable automatic updates by selecting File ➤
Preferences ➤ Settings and then, in the Update section, disable the
background updates option. Figure 1-6 shows an example.
13
Chapter 1 Introducing Visual Studio Code
You will follow the same steps to re-enable updates in the background.
Whenever Visual Studio Code receives an update, you will receive a
notification that suggests you to restart Code in order to apply changes.
The first time you restart Visual Studio Code after an update, you will see
the release note for the version that was installed, as demonstrated in
Figure 1-7.
14
Chapter 1 Introducing Visual Studio Code
Release notes contain the list of new and updated features, as well as
hyperlinks that will open the proper feature page in the documentation.
Insiders builds and stable builds can work side by side without
any issues. Because each lives in its own environment, your setting
customizations and extensions you installed on the stable build will not
be automatically available to the Insiders build and vice versa, so you will
need to provide them again.
16
Other documents randomly have
different content
together in that mighty forest, the dwellers in the woods, resigning
their cheerfulness, began to shed tears.
SECTION C.
Then Rāma cast his eyes on (Bharata) as clad in bark and wearing
matted locks he lay on the earth with joined hands, incapable of
being gazed at, like the Sun at the time of the universal dissolution.
Then recognizing him a little, he took by the hand his brother
Bharata, lean, with a pallid countenance. And smelling the crown of
his head, and embracing that descendant of Raghu, Rāma took
Bharata on his lap and asked him affectionately, "Where was thy
father, child, that thou hast come to the forest? It certainly behoves
thee not to come unto the forest while he is living. Ah! I see thee
come from far after a long time. Why, my child, hast thou come unto
this gloomy forest? Is the king alive, my child, seeing that thou hast
come hither; or, afficted with grief, hath he suddenly gone to the
other world? And, O mild one, child that thou art, thy kingdom ever
thine hath not been wrested from thee? And, O thou having truth for
prowess, dost thou, my child, minister unto our sire? And is that
truthful one, that performer of Rajasuya and Açwamedha, ever
devoted to righteousness, king Daçarātha, well? And, my child, is
that exceedingly effulgent and learned Brāhmana ever steady in
morality, the priest of the Ikshwākus, duly honored? And, my child,
are Kauçalyā, and Sumitrā having a son, in happiness? And is the
noble Kaikeyi in spirits? And is that one, sprung from a mighty line,
humble and versed in various lore, thy priest, who performeth every
ceremony, who beareth no ill will, and whose gaze is ever fixed upon
our welfare,—honored? And do intelligent and sincere people
cognizant of the rules, look after the sacrificial fire? And do they
regularly inform thee of the proper seasons for performing the fire-
sacrifice? A dost thou regard the deities, the ancestral manes, the
preceptors like unto predecessors, the physicians, the Brāhmanas,
and the servants? And dost not disregard the preceptor Sudhanwā,
versed in excellent arms whether inspired with mantras or not, and
accomplished in the knowledge of polity? And, my child, hast thou
employed as thy concillors, persons, heroic, learned, self-controlled,
well-born, and understanding signs, who are like thy own self? O
descendant of Raghu, counsel well kept by clever councillors versed
in lore, is the root of victory with kings. And thou hast not come
under the sway of sleep? And thou awakest at the proper hour? And
dost thou during the short hours revolve the means of acquiring
wealth? And thou dost not take counsel either with thyself alone, or
(on the other hand) with a multiplicity of counsellors? And thy
counsel doth not range the kingdom (i. e. doth not take air)? And, O
descendant of Raghu, having determined upon a course costing
small effort but fraught with a mighty result, thou setst about it
sharply and delayest not? And do the (auxiliary) kings know only
those acts of thine that have been accomplished or those that are
well nigh so, and not those that thou intendest to set thine hand to?
And do others through inference or appearances come at a
knowledge of thy counsels, although undivulged to others by thyself
or thy counsellors; and (do thou and thy ministers) attain to a
knowledge of others' counsels? And passing by a thousand dunces,
dost thou set thy heart on having a single wise man? In times of
pecuniary stress, a wise man stands in excellent stead. And although
a king might be surrounded by a thousand or ten thousand fools, yet
he can count upon no assistance (at their hands). And a single able
counsellor, intelligent, heroic, and sagacious, bringeth great
prosperity upon a king or a prince. And, my child, dost thou employ
the best servants upon the best offices, the middling upon middling,
and the worst upon the worst? And dost thou employ upon the most
worthy offices counsellors who are above bribery, who have served
thy father and grand-father, and who are pure? And do the subjects
visited with condign punishment, as well as the ministers, disregard
thee, O son of Kaikeyi? And do the priests scorn thee like a fallen
one, even as females do those lascivious folks who use force
towards the former? He that doth not slay a physician skilled in ways
and means, a servant given to enlisting the sympathies of his fellow-
servants against his master, or a hero that covets riches, is slain (by
them). And hast thou chosen for thy general one that is confident, is
endowed with intelligence and fortitude, sprung in a respectable
race, and attached and able? And dost thou practically honor thy
foremost warriors possessed of prowess, who have already given
evidence of their manliness? And dost thou at the proper time grant
thy soldiers what thou shouldst—provision and pay; and dost not
delay in doing this? If the proper time for granting provision and pay
be passed, the servants get wroth with their master and tax him;
and great is the evil that springs herefrom. And are the principal
descendants of our race attached unto thee; and are they, when
enlisted on thy side with concentrated minds, ready to lay down
their lives? And, O Bharata, are thy spies persons coming from the
provinces, and learned, upright, endowed with presence of mind,
representing the truth, and possessed of wisdom? And dost thou
acquire intelligence of the expedients, eighteen176 in respect of
others, and fifteen in respect of thy own self,—by means of every
three spies appointed in connection with each of these expedients—
men quite ignorant of each other's counsels? And dost thou not
contemn those weak ones that, O destroyer of thy foes, having been
expelled, have come again (unto thee)? And, my child, thou dost not
minister unto atheistical Brāhmanas? These childish persons proud
of their learning are only fit for bringing evils upon others. While
there are excellent scriptures, these people of subtle intellects,
having acquired a knowledge of dialectics, speak vanities. And, my
child, dost thou protect the prosperous and renowned Ayodhyā,
inhabited formerly by our heroic predecessors; bearing a true name;
having strong gates; filled with elephants, steeds, and cars;
thronged by thousands; with noble Brāhmanas, Kshatriyas and
Vaiçyas breathing high spirits, and with their senses controlled, each
engaged in his own task; abounding in people learned in the Veda;
and surrounded with palatial mansions of various shapes? And, O
descendant of Raghu, are the flourishing provinces marked with
hundreds of Chaityas, filled with prosperous people, graced with
abodes of deities, places for distributing water, and tanks, with men
and women in happy mood, gay with meetings and festivities,
having their outskirts well furrowed, provided with beasts, void of ill
feelings, depending on tanks for their water supply, charming,
renounced by fierce animals, free from all kinds of fear, decked with
mines, left by unrighteous people, and well governed by my
predecessors,— having a good time of it? And do agriculturists and
cowherds find favor in thy sight? And remaining in their respective
vocations, do they enjoy happiness? And dost thou maintain them by
securing unto them what they wish for and removing from them
what they wish away? All the dwellers in his dominions should be
protected by the king. And dost thou conciliate the females; and are
they well protected by thee? And dost thou not regard them; and
dost thou not open unto them thy mind? And are the woods where
elephants breed, kept by thee; and hast thou kine? And dost thou
not foster mares and female-elephants? And dost thou show thyself
daily in the court, well robed? And rising in the morning, dost thou
show thyself in the high-ways? And do thy servants boldly present
themselves before thee; or do they all keep away? A middle course
contributes to their good fortune. And are all the forts furnished with
wealth, corn, arms, water, machines, artizans, and bowmen? And are
thy incomings great and outgoings slender? And, Raghu's
descendant, thou dost not give away thy coffers unto the
undeserving? And dost thou spend thy wealth in the interests of the
deities, or the pitrtis, or the Brāhmanas who have come unto thee,
or warriors, or friends? If any respectable, pure-spirited and clean
person happen to be accused by some one of theft or other crimes,
dost thou from covetuousness punish him without first having him
tried by persons versed in scripture? And, O best of men, is a thief,
that hath been caught, interrogated (as to his guilt), and found with
the stolen property on his person, set free (by thy men) from
motives of gain? And do thy counsellors, O descendant of Raghu,
accomplished in various lore, uninfluenced by greed, consider the
conduct of both the rich and the poor involved in peril? O son of the
Raghu race, the tears of those who have been falsely charged with
any offence, (and who have failed to obtain justice), dropping,
destroy the sons as well as the beasts of the ruler that minds his
own comfort only. And dost thou with these three—gifts, mind and
word—try to win over aged people, boys, physicians, and the
principal ones? And dost thou salute spiritual preceptors, aged
persons, ascetics, gods, guests, Chaityas, emancipated ones, and
Brāhmanas? And thou dost not oppose righteousness by interest, or
interest by virtue, or both by desire, intent on gratifying the senses?
And, O foremost of conquerors, dost thou, O thou cognisant of time,
in season resorting to interest, desire, and virtue respectively, attain
them, O bestower of boons? And do Brāhmanas versed in all
religious lore and knowing interest, together with the citizens and
the inhabitants of the provinces wish for thy happiness, O highly
wise one? Atheism, untruthfulness, inattention, anger,
procrastination, companionship with evil persons, indolence,
gratification of the senses, consultation with a single person
concerning the needs of a kingdom, taking counsel with those that
are cognisant of evils alone, omission to take in hand a task that
hath been decided upon, divulgence of counsel, noncommencement
of a course in the morning, and marching against all the foes at one
and the same time,— hast thou eschewed these ten and four faults?
And, O descendant of Raghu, truly understanding the tenth,177
fifth,178 fourth179 and seventh180 classes as well as the eighth,181
and third ones,182 and the three kinds of learning,183 and victory
over the senses, and the evils human and superhuman, six
attributes,184 and the (peculiar) duties (of royalty), and the twenty
classes,185 and the kinds of Prakritis186 and Mandala,187 and
Yatrā,188 chastisement, and war and peace having each two sources;
dost thou with due order observe all these? And, O wise one, dost
thou, as laid down in the ordinance, take counsel, severally and in a
body with three or four men? And dost thou observe the Vedas? And
dost thou perceive the fruit of thy acts? And have thy wives borne
children? And has thy knowledge of scripture borne fruit? And,
descendant of Raghu, is thy intellect going the way that I have
indicated above? This course is conducive to long life, and fame; and
virtue, desire and interest. And, O child, art thou following the
course that was followed by our ancestors? And art thou maintaining
the conduct that is excellent and passes along pious ways? And, O
son of Raghu, thou dost not alone partake of sapid meats thyself
alone? And dost thou share them with those friends who expect it?
The learned king ruling (all) righteously—that chastiser of the
subjects—the monarch attaining duly the entire earth, going away
from hence, acquires the celestial regions."
SECTION CI.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com