100% found this document useful (5 votes)
41 views

Full download Visual Studio Code Distilled: Evolved Code Editing for Windows, macOS, and Linux - Third Edition Alessandro Del Sole pdf docx

Del

Uploaded by

trinnnerhot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
41 views

Full download Visual Studio Code Distilled: Evolved Code Editing for Windows, macOS, and Linux - Third Edition Alessandro Del Sole pdf docx

Del

Uploaded by

trinnnerhot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Download Full Version ebookmass - Visit ebookmass.

com

Visual Studio Code Distilled: Evolved Code Editing


for Windows, macOS, and Linux - Third Edition
Alessandro Del Sole

https://ebookmass.com/product/visual-studio-code-distilled-
evolved-code-editing-for-windows-macos-and-linux-third-
edition-alessandro-del-sole/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmass.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Visual Studio Code Distilled: Evolved Code Editing for


Windows, macOS, and Linux 3 / converted Edition Alessandro
Del Sole
https://ebookmass.com/product/visual-studio-code-distilled-evolved-
code-editing-for-windows-macos-and-linux-3-converted-edition-
alessandro-del-sole/
ebookmass.com

International Residential Code for One- and Two-Family


Dwellings (International Code Council Series) 2018 1st
Edition International Code Council
https://ebookmass.com/product/international-residential-code-for-one-
and-two-family-dwellings-international-code-council-series-2018-1st-
edition-international-code-council/
ebookmass.com

International Fire Code (International Code Council


Series) 2021 1st Edition International Code Council

https://ebookmass.com/product/international-fire-code-international-
code-council-series-2021-1st-edition-international-code-council/

ebookmass.com

ExpertDDX: Musculoskeletal 2nd Edition Kirkland W. Davis

https://ebookmass.com/product/expertddx-musculoskeletal-2nd-edition-
kirkland-w-davis-2/

ebookmass.com
Tratado de Diálisis Peritoneal 3Ed Montenegro 3Ed Edition
Jesus Montenegro

https://ebookmass.com/product/tratado-de-dialisis-peritoneal-3ed-
montenegro-3ed-edition-jesus-montenegro/

ebookmass.com

(eBook PDF) Introduction to Global Politics 5th Edition

https://ebookmass.com/product/ebook-pdf-introduction-to-global-
politics-5th-edition/

ebookmass.com

Schalm's Veterinary Hematology 7th Edition Marjory B.


Brooks

https://ebookmass.com/product/schalms-veterinary-hematology-7th-
edition-marjory-b-brooks/

ebookmass.com

Memory: A Self-Referential Account Jordi Fernández

https://ebookmass.com/product/memory-a-self-referential-account-jordi-
fernandez/

ebookmass.com

Fluid Inclusion Effect in Flotation of Sulfide Minerals


1st Edition Shuming Wen

https://ebookmass.com/product/fluid-inclusion-effect-in-flotation-of-
sulfide-minerals-1st-edition-shuming-wen/

ebookmass.com
Sustainable Investing: What Everyone Needs to Know H. Kent
Baker

https://ebookmass.com/product/sustainable-investing-what-everyone-
needs-to-know-h-kent-baker-2/

ebookmass.com
Visual Studio
Code Distilled
Evolved Code Editing for Windows,
macOS, and Linux

Third Edition

Alessandro Del Sole
Visual Studio Code
Distilled
Evolved Code Editing for Windows,
macOS, and Linux
Third Edition

Alessandro Del Sole


Visual Studio Code Distilled: Evolved Code Editing for Windows, macOS, and Linux
Alessandro Del Sole
Cremona, Italy

ISBN-13 (pbk): 978-1-4842-9483-3 ISBN-13 (electronic): 978-1-4842-9484-0


https://doi.org/10.1007/978-1-4842-9484-0

Copyright © 2023 by Alessandro Del Sole


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Smriti Srivastava
Development Editor: Laura Berendson
Coordinating Editor: Mark Powers
Copy Editor: Kezia Endsley
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@
springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole
member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc
is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub (github.com/apress). For more detailed information, please visit http://www.apress.
com/source-code.
Printed on acid-free paper
To my wonderful wife, Angelica. You are my reason to live.
Table of Contents
About the Author��������������������������������������������������������������������������������������������������� xiii

Acknowledgments���������������������������������������������������������������������������������������������������xv
Introduction�����������������������������������������������������������������������������������������������������������xvii

Chapter 1: Introducing Visual Studio Code��������������������������������������������������������������� 1


Visual Studio Code, a Cross-Platform Development Tool�������������������������������������������������������������� 1
When and Why Visual Studio Code������������������������������������������������������������������������������������������������ 2
Installing and Configuring Visual Studio Code������������������������������������������������������������������������������ 4
Installing Visual Studio Code on Windows������������������������������������������������������������������������������� 6
Installing Visual Studio Code on macOS���������������������������������������������������������������������������������� 8
Installing Visual Studio Code on Linux������������������������������������������������������������������������������������� 9
Localization Support�������������������������������������������������������������������������������������������������������������� 11
Updating Visual Studio Code�������������������������������������������������������������������������������������������������� 12
Previewing Features with Insiders Builds����������������������������������������������������������������������������� 14
Visual Studio Code on Web���������������������������������������������������������������������������������������������������� 16
Summary������������������������������������������������������������������������������������������������������������������������������������ 17

Chapter 2: Getting to Know the Environment��������������������������������������������������������� 19


The Welcome Page���������������������������������������������������������������������������������������������������������������������� 19
The Code Editor��������������������������������������������������������������������������������������������������������������������������� 21
Reordering, Resizing, and Zooming Editor Windows������������������������������������������������������������� 22
The Status Bar���������������������������������������������������������������������������������������������������������������������������� 22
The Activity Bar��������������������������������������������������������������������������������������������������������������������������� 23
The Side Bar�������������������������������������������������������������������������������������������������������������������������������� 24
The Explorer Bar�������������������������������������������������������������������������������������������������������������������� 24
The Search Tool��������������������������������������������������������������������������������������������������������������������� 30

v
Table of Contents

The Git Bar����������������������������������������������������������������������������������������������������������������������������� 31


The Run and Debug Bar��������������������������������������������������������������������������������������������������������� 32
The Extensions Bar���������������������������������������������������������������������������������������������������������������� 33
The Accounts Button������������������������������������������������������������������������������������������������������������� 34
The Settings Button��������������������������������������������������������������������������������������������������������������� 36
Navigating Between Files����������������������������������������������������������������������������������������������������������� 36
The Command Palette����������������������������������������������������������������������������������������������������������������� 37
The Panels Area�������������������������������������������������������������������������������������������������������������������������� 38
The Problems Panel��������������������������������������������������������������������������������������������������������������� 38
The Output Panel������������������������������������������������������������������������������������������������������������������� 40
The Debug Console Panel������������������������������������������������������������������������������������������������������ 40
Working with the Terminal����������������������������������������������������������������������������������������������������� 41
Summary������������������������������������������������������������������������������������������������������������������������������������ 43

Chapter 3: Language Support and Code Editing Features�������������������������������������� 45


Language Support����������������������������������������������������������������������������������������������������������������������� 45
Working with C# and C++����������������������������������������������������������������������������������������������������� 46
Working with Python������������������������������������������������������������������������������������������������������������� 47
Working with Julia����������������������������������������������������������������������������������������������������������������� 48
Working with Go�������������������������������������������������������������������������������������������������������������������� 48
Basic Code Editing Features������������������������������������������������������������������������������������������������������� 48
Working with Text������������������������������������������������������������������������������������������������������������������ 49
Syntax Colorization���������������������������������������������������������������������������������������������������������������� 50
Delimiter Matching and Text Selection���������������������������������������������������������������������������������� 51
Code Block Folding���������������������������������������������������������������������������������������������������������������� 52
Multicursors�������������������������������������������������������������������������������������������������������������������������� 52
Reusable Code Snippets�������������������������������������������������������������������������������������������������������� 53
Word Completion������������������������������������������������������������������������������������������������������������������� 54
Minimap Mode����������������������������������������������������������������������������������������������������������������������� 55
Sticky Scroll��������������������������������������������������������������������������������������������������������������������������� 56
Whitespace Rendering and Breadcrumbs����������������������������������������������������������������������������� 57
Markdown Preview���������������������������������������������������������������������������������������������������������������� 58

vi
Table of Contents

Evolved Code Editing������������������������������������������������������������������������������������������������������������������� 59


Working with IntelliSense������������������������������������������������������������������������������������������������������ 60
Parameter Hints��������������������������������������������������������������������������������������������������������������������� 62
Inline Documentation with Tooltips��������������������������������������������������������������������������������������� 63
Go to Definition and Peek Definition�������������������������������������������������������������������������������������� 64
Go to Implementation and Peek Implementations����������������������������������������������������������������� 66
Finding References���������������������������������������������������������������������������������������������������������������� 67
Renaming Symbols and Identifiers���������������������������������������������������������������������������������������� 70
Live Code Analysis����������������������������������������������������������������������������������������������������������������� 72
Hints About IntelliCode���������������������������������������������������������������������������������������������������������� 80
Summary������������������������������������������������������������������������������������������������������������������������������������ 80

Chapter 4: Working with Files and Folders������������������������������������������������������������ 81


Visual Studio Code and Project Systems������������������������������������������������������������������������������������ 81
Working with Individual Files������������������������������������������������������������������������������������������������������ 82
Creating Files������������������������������������������������������������������������������������������������������������������������� 84
File Encoding, Line Terminators, and Line Browsing������������������������������������������������������������� 86
Working with Folders and Projects��������������������������������������������������������������������������������������������� 87
Opening a Folder������������������������������������������������������������������������������������������������������������������� 88
Opening .NET Solutions��������������������������������������������������������������������������������������������������������� 90
Opening JavaScript and TypeScript Projects������������������������������������������������������������������������� 91
Opening Loose Folders���������������������������������������������������������������������������������������������������������� 92
Working with Workspaces����������������������������������������������������������������������������������������������������������� 92
Creating Workspaces������������������������������������������������������������������������������������������������������������� 95
Opening Existing Workspaces����������������������������������������������������������������������������������������������� 95
Workspace Structure������������������������������������������������������������������������������������������������������������� 96
Security: Workspace Trust����������������������������������������������������������������������������������������������������� 97
Summary���������������������������������������������������������������������������������������������������������������������������������� 101

vii
Table of Contents

Chapter 5: Customizing Visual Studio Code��������������������������������������������������������� 103


Customizations and Extensions Explained�������������������������������������������������������������������������������� 103
Customizing Visual Studio Code������������������������������������������������������������������������������������������������ 105
Theme Selection������������������������������������������������������������������������������������������������������������������ 105
Customizing the Environment���������������������������������������������������������������������������������������������� 107
Customizing Keyboard Shortcuts���������������������������������������������������������������������������������������� 118
Creating Reusable Profiles�������������������������������������������������������������������������������������������������������� 123
Summary���������������������������������������������������������������������������������������������������������������������������������� 125

Chapter 6: Installing and Managing Extensions��������������������������������������������������� 127


Installing Extensions����������������������������������������������������������������������������������������������������������������� 127
Extension Recommendations���������������������������������������������������������������������������������������������� 131
Useful Extensions���������������������������������������������������������������������������������������������������������������� 133
Managing Extensions���������������������������������������������������������������������������������������������������������������� 134
Configuring Extensions�������������������������������������������������������������������������������������������������������� 136
Writing Your First Extension������������������������������������������������������������������������������������������������������ 138
Setting Up the Environment������������������������������������������������������������������������������������������������� 139
Creating an Extension���������������������������������������������������������������������������������������������������������� 140
Developing the Extension���������������������������������������������������������������������������������������������������� 142
Running the Extension��������������������������������������������������������������������������������������������������������� 145
Packaging Extensions��������������������������������������������������������������������������������������������������������� 147
Extension Development Summary�������������������������������������������������������������������������������������� 148
Summary���������������������������������������������������������������������������������������������������������������������������������� 149

Chapter 7: Source Control with Git����������������������������������������������������������������������� 151


Source Control in Visual Studio Code���������������������������������������������������������������������������������������� 151
Downloading Other Source Control Providers��������������������������������������������������������������������� 152
Managing Repositories������������������������������������������������������������������������������������������������������������� 153
Initializing a Local Git Repository���������������������������������������������������������������������������������������� 154
Creating a Remote Repository��������������������������������������������������������������������������������������������� 155
Handling File Changes�������������������������������������������������������������������������������������������������������������� 159
Staging Changes����������������������������������������������������������������������������������������������������������������� 160

viii
Table of Contents

Managing Commits������������������������������������������������������������������������������������������������������������������� 161


Working with the Git Command-Line Interface������������������������������������������������������������������������� 163
Creating and Managing Branches��������������������������������������������������������������������������������������������� 164
Switching to a Different Branch������������������������������������������������������������������������������������������ 166
Merging from a Branch�������������������������������������������������������������������������������������������������������� 166
Hints About Rebasing Branches������������������������������������������������������������������������������������������ 170
Deleting Branches��������������������������������������������������������������������������������������������������������������� 170
Adding Power to the Git Tooling with Extensions���������������������������������������������������������������������� 170
Git History���������������������������������������������������������������������������������������������������������������������������� 171
GitLens��������������������������������������������������������������������������������������������������������������������������������� 172
GitHub Pull Requests and Issues����������������������������������������������������������������������������������������� 174
Working with Azure DevOps������������������������������������������������������������������������������������������������������ 178
Creating a Team Project������������������������������������������������������������������������������������������������������ 178
Connecting Visual Studio Code to a Remote Repository����������������������������������������������������� 181
Summary���������������������������������������������������������������������������������������������������������������������������������� 182

Chapter 8: Automating Tasks������������������������������������������������������������������������������� 185


Understanding Tasks����������������������������������������������������������������������������������������������������������������� 185
Tasks Types������������������������������������������������������������������������������������������������������������������������� 186
Running and Managing Tasks���������������������������������������������������������������������������������������������� 187
The Default Build Task��������������������������������������������������������������������������������������������������������� 192
Auto-Detected Tasks������������������������������������������������������������������������������������������������������������ 192
Configuring Tasks���������������������������������������������������������������������������������������������������������������� 194
Running Files with a Default Program��������������������������������������������������������������������������������� 213
Summary���������������������������������������������������������������������������������������������������������������������������������� 213

Chapter 9: Building and Debugging Applications������������������������������������������������� 215


Creating Applications���������������������������������������������������������������������������������������������������������������� 215
The Status of Microsoft .NET����������������������������������������������������������������������������������������������� 216
Creating .NET Projects��������������������������������������������������������������������������������������������������������� 217
Creating Projects on Other Platforms���������������������������������������������������������������������������������� 223

ix
Table of Contents

Debugging Your Code���������������������������������������������������������������������������������������������������������������� 225


Configuring the Debugger��������������������������������������������������������������������������������������������������� 227
Managing Breakpoints�������������������������������������������������������������������������������������������������������� 230
Debugging an Application���������������������������������������������������������������������������������������������������� 231
Configuring Debug Options�������������������������������������������������������������������������������������������������� 237
Summary���������������������������������������������������������������������������������������������������������������������������������� 238

Chapter 10: Building Applications with Python���������������������������������������������������� 239


Chapter Prerequisites��������������������������������������������������������������������������������������������������������������� 239
Creating Python Applications����������������������������������������������������������������������������������������������� 241
Running Python Code���������������������������������������������������������������������������������������������������������� 243
Code Editing Features for Python���������������������������������������������������������������������������������������������� 250
Enhanced Word Completion with IntelliSense��������������������������������������������������������������������� 250
Understanding Function Parameters with Parameter Hints������������������������������������������������ 251
Quickly Retrieving Type Definitions������������������������������������������������������������������������������������� 251
Finding References�������������������������������������������������������������������������������������������������������������� 252
Renaming Symbols�������������������������������������������������������������������������������������������������������������� 253
Finding Code Issues with Linters����������������������������������������������������������������������������������������� 254
Advanced Code Editing with Pylance���������������������������������������������������������������������������������������� 257
Managing Pylance Settings������������������������������������������������������������������������������������������������� 260
Running Python Scripts������������������������������������������������������������������������������������������������������������� 261
Summary���������������������������������������������������������������������������������������������������������������������������������� 262

Chapter 11: Deploying Applications to Azure������������������������������������������������������� 263


Introducing Azure Extensions���������������������������������������������������������������������������������������������������� 263
Deploying Web Applications������������������������������������������������������������������������������������������������������ 265
Installing Extensions������������������������������������������������������������������������������������������������������������ 265
Signing In to Azure Subscriptions���������������������������������������������������������������������������������������� 266
Publishing Web Applications������������������������������������������������������������������������������������������������ 268
Creating and Deploying Azure Functions���������������������������������������������������������������������������������� 271
Configuring Visual Studio Code������������������������������������������������������������������������������������������� 271
Creating Azure Functions����������������������������������������������������������������������������������������������������� 273
Deploying Azure Functions�������������������������������������������������������������������������������������������������� 280
x
Table of Contents

Deploying Docker Images��������������������������������������������������������������������������������������������������������� 283


Docker Prerequisites����������������������������������������������������������������������������������������������������������� 284
Creating the Application Image������������������������������������������������������������������������������������������� 285
Uploading the Application Image to a Container Registry��������������������������������������������������� 287
Deploying the Docker Image to Azure��������������������������������������������������������������������������������� 290
Summary���������������������������������������������������������������������������������������������������������������������������������� 292

Chapter 12: Consuming AI Services��������������������������������������������������������������������� 295


Introducing Azure for AI������������������������������������������������������������������������������������������������������������� 296
General Considerations������������������������������������������������������������������������������������������������������������� 297
Introducing Computer Vision����������������������������������������������������������������������������������������������� 297
Setting Up Computer Vision Services���������������������������������������������������������������������������������������� 297
Retrieving the Service Keys������������������������������������������������������������������������������������������������� 302
Consuming AI Services with .NET��������������������������������������������������������������������������������������������� 304
Setting Up Variables and Constants������������������������������������������������������������������������������������ 306
Creating Authenticated Service Clients������������������������������������������������������������������������������� 308
Executing Image Analysis���������������������������������������������������������������������������������������������������� 309
Running the Application������������������������������������������������������������������������������������������������������ 313
Consuming AI Services with JavaScript������������������������������������������������������������������������������������ 315
Setting Up Variables and Constants������������������������������������������������������������������������������������ 317
Creating Authenticated Service Clients������������������������������������������������������������������������������� 318
Executing Image Analysis���������������������������������������������������������������������������������������������������� 319
Running the Application������������������������������������������������������������������������������������������������������ 322
Consuming AI Services with Python����������������������������������������������������������������������������������������� 323
Setting Up Variables and Constants������������������������������������������������������������������������������������ 324
Creating Authenticated Service Clients������������������������������������������������������������������������������� 325
Executing Image Analysis���������������������������������������������������������������������������������������������������� 326
Running the Application������������������������������������������������������������������������������������������������������ 329
Summary���������������������������������������������������������������������������������������������������������������������������������� 330

Index��������������������������������������������������������������������������������������������������������������������� 331

xi
About the Author
Alessandro Del Sole is a senior software engineer for a
healthcare company, building mobile apps for doctors and
dialysis patients. He has been in the software industry for
more than 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#.

xiii
Acknowledgments
Thanks to Smriti Srivastava, Nirmal Selvaraj, Laura Berendson, and everyone else at
Apress for the opportunity, renewed trust, and the great teamwork on this book.
Special thanks to the technical editor Damien Foggon, who contributed to the
quality and accuracy of the content.
Special thanks to my wife Angelica, for her continuous and strong support.

xv
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, and of architectures
based on microservices.
Developers have many options for building cross-platform and cross-device
software, from languages to development platforms and tools. However, in most cases,
such tools rely on proprietary systems, which result in strong dependencies. Moreover,
most development tools target specific platforms and development scenarios. Microsoft
Visual Studio Code takes a step forward by providing a fully featured development
environment for Windows, macOS, and Linux that offers not only advanced coding
features but also integrated tools. These tools span across the entire application lifecycle,
from coding to debugging to team collaboration. The full tooling is consistent across
these languages and frameworks, natively or via extensions, so that developers share the
same experience regardless of the technology they use.
With .NET 7 and with .NET MAUI recently released, and with artificial intelligence
services becoming part of the modern software implementation, Visual Studio Code
becomes even more important to support cross-platform development on multiple
operating systems. In this book, developers with any skill level learn how to leverage
Visual Studio Code to target scenarios such as web, cloud, and mobile development
using the programming language of their choice. This book provides guidance on
building apps for any system and any device. This includes managing the application
lifecycle, as well as team collaboration.

xvii
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 in different development platforms. It
supports the application development lifecycle with a built-in debugger and integrated
support for the popular Git version control engine.
With Visual Studio Code, you can work with individual code files or with folders
containing projects or loose files. This chapter provides an introduction to Visual Studio
Code, giving you information on when and why you should use it. It includes details
about installing and configuring the program on the different supported operating
systems.

Note In this book, I refer to the product using its full name, Visual Studio Code, as
well as its friendly names, VS Code and Code, interchangeably.

 isual Studio Code, a Cross-Platform


V
Development Tool
Visual Studio Code is the first cross-platform development tool in the Microsoft Visual
Studio family that runs on Windows, Linux, and macOS. It is a free, open-source
(https://github.com/microsoft/vscode), code-centric tool. This not only makes
editing code files and folder-based project systems easier, but also facilitates writing
cross-platform web, mobile, and cloud applications in the most popular platforms, such

1
© Alessandro Del Sole 2023
A. Del Sole, Visual Studio Code Distilled, https://doi.org/10.1007/978-1-4842-9484-0_1
Chapter 1 Introducing Visual Studio Code

as Node.js and .NET. It also has integrated support for a huge number of languages and
rich editing features such as IntelliSense, finding symbol references, quickly reaching a
type definition, and much more.
Visual Studio Code is based on Electron (https://electronjs.org/), a framework
for creating cross-platform applications with native technologies. It combines the
simplicity of a powerful code editor with the tools a developer needs to support the
application lifecycle development, including debuggers and version control integration
based on Git. Visual Studio Code is therefore a complete development tool, rather than
being a simple code editor. For a richer development experience, consider Microsoft
Visual Studio 2022 on Windows and Visual Studio 2022 for Mac on macOS, but Visual
Studio Code can be really helpful in many situations.
In this book, you learn how to use Visual Studio Code and how to get the most
out of it; you discover how you can use it as a powerful code editor and as a complete
environment for end-to-end development. Except where necessary to differentiate
operating systems, figures are based on Microsoft Windows 10, but typically there is
no difference in the interface on Windows 11, Linux, and macOS. Also, Visual Studio
Code includes several color themes that style its layout. In this book, figures display the
Light (Visual Studio) theme, so you might see different colors on your own screen if you
choose a different color theme. Chapter 5 explains how to change the theme, but if you
want to be consistent with the book’s figures, simply choose File ➤ Preferences ➤ Color
Theme and select the Visual Studio 2019 Light Theme. It is worth mentioning that the
theme you select does not affect the features described in this book.

When and Why Visual Studio Code


Before you learn how to use Visual Studio Code, explore the features it offers, and
discover how it provides an improved code editing experience, you have to clearly
understand its purpose. Visual Studio Code is not a simple code editor; rather, it is a
powerful environment that puts writing code at its center. The main purpose of Visual
Studio Code is to make it easier to write code for web, mobile, and cloud platforms for
any developers working on Windows, Linux, or macOS, providing independence from
proprietary development environments.
For a better understanding of the nonproprietary nature of Visual Studio Code,
let’s consider an example based on ASP.NET Core, the cross-platform, open-source
technology able to run on Windows, Linux, and macOS that Microsoft produced to

2
Chapter 1 Introducing Visual Studio Code

create portable web applications. Forcing you to build cross-platform, portable web apps
with Microsoft Visual Studio 2022 would make you dependent on that specific integrated
development environment (IDE). This also applies to the (free) Visual Studio 2022
Community edition. Conversely, though Visual Studio Code certainly is not intended to
be a replacement for more powerful and complete environments, it can run on a variety
of operating systems and can manage different project types, as well as the most popular
languages. To accomplish this, Visual Studio Code provides the following core features:

• Built-in support for coding in many languages, including those


you typically use in cross-platform development scenarios, such as
C# and JavaScript, with advanced editing features and support for
additional languages via extensibility

• Built-in debugger for Node.js, with support for additional debuggers


(such as .NET and Julia) via extensibility

• Version control based on the popular Git version-control system,


which provides an integrated experience for collaboration,
supporting code commits and branches

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 with this assumption, Visual Studio Code offers an advanced editing
experience with features that are common to many supported languages, plus some
features that are available to specific languages. As you’ll 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 it is not intended to be the best
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 command-line
interface (CLI), a compiler, and a debugger. If you use a language
for which there is no extensive support (e.g., the open-source Go
programming language, https://golang.org), Visual Studio Code
3
Chapter 1 Introducing Visual Studio Code

cannot invoke a compiler. You can work around this by implementing


task automation, discussed in Chapter 8, but this is different than
having an integrated compilation process.

• Except where provided by specific extensions, Visual Studio Code


has no designers, so you can create an application user interface
only by writing all of the related code manually. As you can imagine,
this is fine for some languages and for some scenarios, but it can be
very complicated with some kinds of applications and development
platforms, especially if you are used to working with the powerful
graphical tools available in Microsoft Visual Studio 2022.

• Visual Studio Code is a general-purpose tool and is not the proper


choice for specific development scenarios such as building Windows
desktop applications.

If your requirements are different, consider Microsoft Visual Studio 2022 or Microsoft
Visual Studio 2022 for Mac instead, which are optimized for building, testing, deploying,
and maintaining multiple types of applications.
Now that you have a clearer idea of Code’s goals, you are ready to learn the amazing
editing features that elevate it above any other code editor.

Installing and Configuring Visual Studio Code


Installing Visual Studio Code is an easy task. In fact, you can simply visit https://
code.visualstudio.com from your favorite browser, and the web page will detect
your operating system, suggesting the appropriate installer. Figure 1-1 shows how the
download page appears on Windows.

4
Chapter 1 Introducing Visual Studio Code

Figure 1-1. The download page for Visual Studio Code

Note Visual Studio Code can also run in Portable Mode, which means that
you can create a self-containing folder that can be moved across environments.
Since this is a very specific scenario, it isn’t covered in this book; you can read
the documentation (https://code.visualstudio.com/docs/editor/
portable) to learn the steps required to generate Portable Mode.

In the following sections, you learn some tips for installing Visual Studio Code on
various supported systems.

Note The latest stable release of Visual Studio Code at the time of this writing is
version 1.76.0, released in February 2023.

5
Chapter 1 Introducing Visual Studio Code

Installing Visual Studio Code on Windows


Visual Studio Code can be installed on Windows 8, 10, and 11. For this operating system,
Visual Studio Code is available with two installers: a global installer and a user-level
installer. The global installer requires administrative privileges for installation and
makes Code available to all users. The user-level installer makes Code available only to
the currently logged-in user, but it does not require administrative privileges.
The user-level installer 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 user-level installer. If you instead want to download the
system-level installer, go to https://code.visualstudio.com/download and select
the System Installer download that best fits your system configuration (32- or 64-bit,
or ARM).
Once the download has been completed, launch the installer and simply follow the
guided procedure that is typical of most 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 box, make sure you select (at
least) the following options:

• Add “Open with Code” action to Windows Explorer file context


menu, which allows you to right-click a code file in the Explorer and
open a file with VS Code.

• Add “Open with Code” action to Windows Explorer directory


context menu, which allows you to right­click a folder in the Explorer
and open a folder with VS Code.

• Add to PATH (available after restart), which adds the VS Code’s


pathname to the PATH environment variable, making it easy to run
Visual Studio Code from the command line without typing the
full path.

Note Some antivirus and system protection tools, such as Symantec Endpoint
Protection, might block the installation of some files that are recognized as false
positives. In most cases, this will not prevent Visual Studio Code from working, but

6
Chapter 1 Introducing Visual Studio Code

it is recommended that you disable the protection tool before installing Code or,
if you do not have elevated permissions, that you ask your administrator to do it
for you.

A specific dialog box will inform you once the installation process has completed.
The installation folder for the user-level installer is ­C:\Users\username\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 it starts, Visual Studio Code appears as shown in Figure 1-2.

Figure 1-2. Visual Studio Code running on Windows

7
Chapter 1 Introducing Visual Studio Code

Installing Visual Studio Code on macOS


Installing VS Code on macOS is extremely simple. From the download page, simply click
the Download for macOS button and wait for the download to complete. On macOS,
Visual Studio Code works as an individual program, and therefore you simply need to
double-click the downloaded file to start the application. Figure 1-3 shows Visual Studio
Code running on macOS.

Figure 1-3. Visual Studio Code running on macOS

8
Chapter 1 Introducing Visual Studio Code

Installing Visual Studio Code on Linux


Linux is a very popular operating system and many derived distributions exist, so
there are different installers available depending on the distribution you are using.
For the Ubuntu and Debian distributions, you need the .deb installer. For the Red Hat
Linux, Fedora, and SUSE distributions, you need the .rpm installer. This clarification is
important because, as opposed to Windows and macOS, the browser might not be able
to automatically detect the Linux distribution you are using, and therefore it will offer
both options.
Once Visual Studio Code is installed, simply click the Show Applications button on
the Desktop and then choose the Visual Studio Code shortcut. Figure 1-4 shows Visual
Studio Code running on Ubuntu.

9
10
Chapter 1
Introducing Visual Studio Code

Figure 1-4. Visual Studio Code running on Ubuntu


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 could install the latest Ubuntu version (https://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.

Localization Support
Visual Studio Code ships in English, but it can be localized in many other supported
languages and cultures. When it's started, VS Code checks for the operating system
language and, if it's different from English, it shows a popup message suggesting to
install a language pack for the culture of your operating system. The localization support
can be also enabled manually.
To accomplish this, choose View ➤ Command Palette. When the text box appears at
the top of the page, type the following command:

> Configure Display Language

You can also just type configure display and the command will be automatically
listed in the command palette (see Figure 1-5).

Figure 1-5. Invoking the command to change the localization

Note The Command Palette is discussed thoroughly in Chapter 2.

11
Chapter 1 Introducing Visual Studio Code

When you click this command, the Command Palette displays the following options:

• English (en), which allows you to select American English as the


culture. This is the default localization and is always available.

• A list of available language packs built by Microsoft.

When you select a language pack, VS Code will download the appropriate package
and will show a message saying that a restart is required in order to localize the user
interface.

Updating Visual Studio Code


Visual Studio Code is configured to receive automatic updates in the background;
Microsoft usually releases monthly updates.

Note Because VS Code receives monthly updates, some features might have
been updated at the time of your reading, and others might be new. This is a
necessary clarification you should keep in mind while reading, and it is also the
reason that I also provide links to the official documentation, so that you can stay
up to date more easily.

Additionally, you can manually check for updates by choosing Help ➤ Check for
Updates on Windows and Linux or choosing 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 choosing File ➤ Preferences ➤ Settings. Then, in the
Update section of the Application settings group, disable the Background Updates
option. Figure 1-6 shows an example based on Windows. (Obviously, on macOS and
Linux, the Enable Windows Background Updates option is not available.)

12
Chapter 1 Introducing Visual Studio Code

Figure 1-6. Disabling automatic updates

You follow the same steps to re-enable updates in the background. Whenever Visual
Studio Code receives an update, you will receive a notification suggesting that you restart
Code in order to apply the changes. The first time you restart Visual Studio Code after an
update, you will see the release notes for the version that was installed, as demonstrated
in Figure 1-7.

13
Chapter 1 Introducing Visual Studio Code

Figure 1-7. VS Code release notes

Release notes contain the list of new and updated features, as well as hyperlinks that
will open the proper feature page in the documentation. You can recall release notes at
any time by choosing Help ➤ Show Release Notes.

Previewing Features with Insiders Builds


By default, the download page of the Visual Studio Code’s website allows you to
download the latest stable build. However, Microsoft periodically also releases preview
builds of Visual Studio Code, called Insiders builds. You can download these Insiders
builds to look at any new and updated upcoming features before they are released to the
general public.

14
Chapter 1 Introducing Visual Studio Code

Insiders builds can be downloaded from https://code.visualstudio.com/


insiders, and they follow the same installation rules described previously for each
operating system. They have a different icon color, typically a green icon instead of a blue
icon, and the name you see in the application bar is Visual Studio Code - Insiders instead
of Visual Studio Code (see Figure 1-8).

Figure 1-8. Visual Studio Code Insiders builds

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.
Insiders builds are a very good way to see what is coming with Visual Studio Code,
but because they are not stable, final builds, it is not recommended you use them in
production or with code you will release to production.

15
Chapter 1 Introducing Visual Studio Code

Visual Studio Code on Web


Microsoft is working on making Visual Studio Code available as a web application
running in your favorite browser.
This is currently available as a preview and can be reached at https://vscode.dev.
A shortcut is also available in the main site for Visual Studio Code. Figure 1-9 shows how
VS Code looks in the browser.

Figure 1-9. Visual Studio Code as a web app

When running in the browser, Visual Studio Code offers the same features available
on the regular desktop app. You can also fully customize your development environment
and experience, and changes will be saved into the local cache. This is a very interesting
alternative, but still in preview stage at the time of this writing.

16
Chapter 1 Introducing Visual Studio Code

S
 ummary
Visual Studio Code is not a simple code editor, but a fully featured development
environment optimized for web, mobile, and cloud development. In this chapter, you
saw how to install Visual Studio Code on Windows, macOS, and Linux distributions,
learning how to select the appropriate installers and fine-tune the setup process. You
also saw how to configure localization and updates. Next, you looked at the Insiders
builds, which offer previews of upcoming, unreleased features. Finally, you saw Visual
Studio Code running in the browser as a web app, with the same features as the desktop
version.
Now that your environment is ready for use, it is time to start discovering the
amazing features offered by Visual Studio Code. The next chapter walks through the
environment, then in Chapter 3, you learn about all the amazing code-editing features
that make Visual Studio Code a rich, powerful cross­platform editor.

17
CHAPTER 2

Getting to Know
the Environment
Before you use Visual Studio Code as the editor of your choice, you need to know how
the workspace is organized and what commands and tools are available, in order to get
the most out of the development environment.
The VS Code user interface and layout are optimized to maximize the space for code
editing, and it also provides easy shortcuts to quickly access all the additional tools you
need in a given context. More specifically, the user interface is divided into five areas:
the code editor, the Status Bar, the Activity Bar, the Panels area, and the Side Bar. This
chapter explains how the user interface is organized and how you can be productive
using it.

Note All the features discussed in this chapter apply to any file in any language,
and they are available regardless of the language you see in the figures (normally
C#). You can open one or more code files via File ➤ Open File to access the editor
windows and explore the features discussed in this chapter. Then, Chapter 4
discusses more thoroughly how to work with individual files and multiple files, in
one or more languages, concurrently.

The Welcome Page


At startup, Visual Studio Code displays the Welcome page, as shown in Figure 2-1.

19
© Alessandro Del Sole 2023
A. Del Sole, Visual Studio Code Distilled, https://doi.org/10.1007/978-1-4842-9484-0_2
Chapter 2 Getting to Know the Environment

Figure 2-1. The Welcome page

On the left side of the page, under the Start group, you find shortcuts for creating and
opening files and folders, and for cloning an existing Git repository. Under the Recent
group is a list of recently opened files and folders that you can click for fast opening.
Under the Walkthroughs group, there are useful links to product documentation,
tutorials, cheat sheets, introductory videos, and other learning resources about Visual
Studio Code.
By default, the Welcome page is set to appear every time you launch VS Code. To
change this default behavior, remove the check mark from the Show Welcome Page On
Startup check box. To re-enable the Welcome page on startup, choose Help ➤ Welcome
and add the check mark back.

20
Chapter 2 Getting to Know the Environment

The Code Editor


The code editor is certainly the area where you will spend most of your time in VS Code.
The code editor becomes available when you create a new file or open existing files and
folders. You can edit one file at a time or edit multiple files side by side concurrently.
Figure 2-2 shows an example of the latter.

Figure 2-2. The code editor and multiple file views

To do this, you have a couple options:

• Right-click a filename in the Explorer Bar and then select Open to


the Side.
• Ctrl-click a filename in the Explorer Bar. This is discussed in the
section “The Side Bar” later in this chapter.

• Press Ctrl+\ (or ⌘+\ on macOS) to split the editor into two.

21
Chapter 2 Getting to Know the Environment

Open editors can also be organized into groups. To accomplish this, you can drag
and drop the title of an open editor close to another one and they will be grouped in
the same space and the Explorer Bar will show the list of groups. You can quickly switch
between editors by pressing Ctrl+1, 2, and so on, until 9. Keep in mind this works with up
to nine editor windows. The code editor is the heart of Visual Studio Code and provides
tons of powerful productivity features that are discussed in detail in the next chapter. For
now, it is enough to know how to open and arrange editor windows.

Reordering, Resizing, and Zooming Editor Windows


You can reorder and resize editor windows based on your preferences. To reorder an
editor, click the editor’s header (which is where you see the filename) and move the
editor to a different position. Resizing an editor can instead be accomplished by clicking
the left mouse button when the pointer is on the editor’s border, until it appears as a left/
right arrow pair.
You can also zoom in and out the environment by clicking Ctrl++ and Ctrl+-,
respectively. As an alternative, you can choose View ➤ Appearance ➤ Zoom In and View
➤ Appearance ➤ Zoom Out. You can reset the original zoom factor with Appearance ➤
Reset Zoom.

Note In Visual Studio Code, the zoom is actually an accessibility feature. As an


implication, when you zoom the code editor, everything else will also be zoomed.

The Status Bar


The Status Bar contains information about the current file or folder and provides
shortcuts for some quick actions. Figure 2-3 shows an example of how the Status Bar
appears.

Figure 2-3. The Status Bar

22
Chapter 2 Getting to Know the Environment

The Status Bar contains the following information, from left to right:

• Git version control information and options, such as the current


branch. This is only visible when VS Code is connected to a Git
repository.

• Errors and warnings detected in the source code.

• The cursor position expressed in line and column.

• Tab size, in this case Spaces: 4. You can click this to change the
indentation size and to convert indentation to tabs or spaces.

• The encoding of the current file.

• The current line terminator.

• The programming or markup language of the open file. By clicking


the current language name, you can change the language from a
drop-down list that pops up.

• The project name, if you open a folder that contains a supported


project system. It is worth noting that, if the folder contains multiple
project files, clicking this item enables you to switch between
projects.

• The Feedback button, which enables you to share your feedback


about Visual Studio Code on Twitter.

• The notification icon, which shows the number of new notifications


(if any). Notification messages typically come from extensions or they
are about product updates.

It is worth mentioning that the color of the Status Bar changes depending on the
situation. For example, it is purple when you open a single file, blue when you open a
folder, and orange when Visual Studio Code is in debugging mode. Additionally, third-­
party extensions might use the Status Bar to display their own information.

The Activity Bar


The Activity Bar is on the left side of the workspace and can be considered a collapsed
container for the Side Bar. Figure 2-4 shows the Activity Bar.

23
Chapter 2 Getting to Know the Environment

Figure 2-4. The Activity Bar

The Activity Bar provides shortcuts for the Explorer, Search, Git, Run and Debug,
Extensions, Accounts, and Settings tools, each described in the next section. When you
click a shortcut, the Side Bar related to the selected tool becomes visible. You can click
the same shortcut again to collapse the Side Bar.

The Side Bar


The Side Bar is one of the most important tools in Visual Studio Code, and one of
the tools you will interact most with. It is composed of five tools, each enabled by the
corresponding icon, described in the following subsections.

The Explorer Bar


The Explorer Bar is enabled by clicking the first icon from the top of the Side Bar and
provides a structured, organized view of the folder or files you are working with. The
list of active files can be shown in the OPEN EDITORS subview. This can be enabled by

24
Chapter 2 Getting to Know the Environment

clicking the ... button and then selecting Open Editors. It also includes open files that are
not part of a project, folder, or files that have been modified. These are instead shown in
a subview whose name is the folder or project name. Figure 2-5 provides an example of
Explorer.

Figure 2-5. The Explorer Bar

25
Chapter 2 Getting to Know the Environment

You must hover your cursor over any file or folder to make the four buttons visible.
The subview that shows a folder structure provides four buttons (from left to right): New
File, New Folder, Refresh Explorer, and Collapse Folders in Explorer, each of which is
self-explanatory. The OPEN EDITORS subview has three buttons (which you get when
hovering over with the mouse): New Untitled Text File, Save All, and Close All Editors.
Right-clicking a folder or filename in Explorer provides a context menu that offers
common commands (such as Open to the Side, referenced earlier in this chapter). A very
interesting command is Reveal in File Explorer (or Reveal to Finder on Mac and Open
Containing Folder on Linux), which opens the containing folder for the selected item.
Notice that the Explorer icon in the Activity Bar also reports the number of unsaved files.

The Outline View


The bottom of the Explorer Bar contains another group, called OUTLINE. This group
provides a hierarchical view of types and members defined within a code file or tags.
Figures 2-6 and 2-7 show the OUTLINE group based on a TypeScript file and based on
an HTML file, respectively.

26
Chapter 2 Getting to Know the Environment

Figure 2-6. The Outline view on a TypeScript file

27
Random documents with unrelated
content Scribd suggests to you:
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or expense
to the user, provide a copy, a means of exporting a copy, or a means
of obtaining a copy upon request, of the work in its original “Plain
Vanilla ASCII” or other form. Any alternate format must include the
full Project Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in paragraph
1.F.3, the Project Gutenberg Literary Archive Foundation, the owner
of the Project Gutenberg™ trademark, and any other party
distributing a Project Gutenberg™ electronic work under this
agreement, disclaim all liability to you for damages, costs and
expenses, including legal fees. YOU AGREE THAT YOU HAVE NO
REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF
WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE
FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving it,
you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or entity
that provided you with the defective work may elect to provide a
replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth in
paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and distribution
of Project Gutenberg™ electronic works, harmless from all liability,
costs and expenses, including legal fees, that arise directly or
indirectly from any of the following which you do or cause to occur:
(a) distribution of this or any Project Gutenberg™ work, (b)
alteration, modification, or additions or deletions to any Project
Gutenberg™ work, and (c) any Defect you cause.

Section 2. Information about the Mission of


Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.
Section 3. Information about the Project
Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many small
donations ($1 to $5,000) are particularly important to maintaining tax
exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About Project


Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.

Project Gutenberg™ eBooks are often created from several printed


editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like