<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Visual Studio Code - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Visual Studio Code - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 11 Jun 2026 20:57:03 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/visual-studio-code/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How To Use Prettier in Visual Studio Code ]]>
                </title>
                <description>
                    <![CDATA[ Nowadays, every tech company strives to build quality software fast. That's why every developer must learn how to write clean and readable code.  But when a project is managed by multiple developers, the focus shifts into consistency especially in te... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-prettier-in-visual-studio-code/</link>
                <guid isPermaLink="false">66bc4d219212975c61bba79c</guid>
                
                    <category>
                        <![CDATA[ Prettier ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Matéu.sh ]]>
                </dc:creator>
                <pubDate>Mon, 18 Mar 2024 12:35:12 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/03/Prettier.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Nowadays, every tech company strives to build quality software fast. That's why every developer must learn how to write clean and readable code. </p>
<p>But when a project is managed by multiple developers, the focus shifts into consistency especially in terms of written code. </p>
<p>Keeping a consistent code style and formatting across many team members and project is a challenging task. It's almost impossible to do it manually, but that's where Prettier comes into play.</p>
<p>In this guide, you will learn how to install Prettier in Visual Studio Code and how to use it to format code.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before you follow this guide, you will need to download and install <a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a>.</p>
<h2 id="heading-what-is-prettier">What is Prettier?</h2>
<p>Prettier is a powerful code formatter that automates this process from start to finish. It gives you confidence that your code adheres to defined coding standards without any manual actions (unless you want to have it manual).   </p>
<p>Prettier not only supports all JavaScript libraries and frameworks, such as Angular, React, Vue, and Svelte, but also works with TypeScript.</p>
<p>That's why it is used by many people in tech worldwide.</p>
<h2 id="heading-how-to-install-prettier-in-visual-studio-code">How To Install Prettier in Visual Studio Code</h2>
<p>To install Prettier in Visual Studio Code, you need to:</p>
<ol>
<li>Open the Extensions tab.</li>
<li>Type prettier in the search box.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---1--2-.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Extensions</em></p>
<p>At the top of the list you will find the Prettier - Code formatter extension. You need to open it, and click the Install button:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Extensions / Prettier - Code Formatter</em></p>
<p>After the successful installation you will see the text saying "This extension is enabled globally"<em>:</em></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---2--1-.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Extensions / Prettier - Code Formatter (Installation completed)</em></p>
<h2 id="heading-how-to-activate-prettier-in-visual-studio-code">How To Activate Prettier in Visual Studio Code</h2>
<p>When your Prettier extension is installed, you need to configure Visual Studio Code to take advantage of it. You can do in the Settings tab. </p>
<p>Side node: to open the Settings tab, you can use <code>COMMAND + ,</code> on macOS or <code>CTRL + ,</code> on Windows and Linux:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---4.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Main view</em></p>
<p>At the top of the Settings tab you will find a search box. Now, you need to type formatter, and then Editor: Default Formatter will pop up on the settings list:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---5.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Settings</em></p>
<p>Now, open the dropdown and select Prettier - Code formatter from the list:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---6.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Settings / Default Formatter</em></p>
<p>Now, Prettier is your default code formatter, but you might want to enable Visual Studio Code to automatically format code when you save files. </p>
<p>If you want to, just tick the checkbox in the Format On Save section:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---7.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Settings / Format On Save</em></p>
<h2 id="heading-how-to-format-code-with-prettier-in-visual-studio-code">How To Format Code with Prettier in Visual Studio Code</h2>
<p>Let's take a look at one React component I created: </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---8--2-.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Unformatted React 18 Component</em></p>
<p>As you can see, this code is completely misaligned, it misses semicolons, and it is very difficult to read. The code could formatted in a better way, right? Here's where Prettier comes into play.  </p>
<p>To format code, we need to open the command palette – you can use <code>COMMAND + SHIFT + P</code> on macOS or <code>CTRL + SHIFT + P</code> on Windows and Linux. </p>
<p>Now, you need to find Format Document. Feel free to use the search box:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---9.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Format Document command</em></p>
<p>After running Format Document your code becomes neat and clean:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/03/Prettier---10.png" alt="Image" width="600" height="400" loading="lazy">
<em>Visual Studio Code / Formatted React 18 Component (with Prettier)</em></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Integrating Prettier into Visual Studio Code is a game-changer for developers striving to maintain a consistent and high-quality codebase. </p>
<p>By automating the formatting process, you are not only adhering to coding standards but are also reducing the struggle that comes with manual code formatting. That's why every developer should use Prettier to ensure consistency in their codebase. </p>
<p>I hope this article helped you a lot. It'd mean the world to me if you shared it on your social media.</p>
<p>If you have any questions you can reach me on <a target="_blank" href="https://twitter.com/msokola">Twitter</a>.</p>
<h2 id="heading-learn-react">Learn React</h2>
<p>Looking for a practical course to learn React? </p>
<p>🚀 <strong>Join my <a target="_blank" href="https://assets.mateu.sh/r/fcc-prettier-guide">React 18 Course on Udemy</a></strong>.</p>
<p>This course includes:</p>
<ul>
<li>🎥 5.5 hours on-demand video</li>
<li>📱 Access on mobile and TV</li>
<li>🗓️ Full lifetime access</li>
<li>🎓 Certificate of completion</li>
</ul>
<p>Click below to enroll.</p>
<p><a target="_blank" href="https://assets.mateu.sh/r/fcc-prettier-guide"><img src="https://assets.mateu.sh/assets/fcc-prettier-guide" alt="React 18 on Udemy" width="600" height="400" loading="lazy"></a><br><em>Click to get started</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Configure Visual Studio Code for Python Development ]]>
                </title>
                <description>
                    <![CDATA[ Visual Studio Code is one of the most versatile code editors out there. Even though it's a code editor, the sheer extensibility of the program makes it almost as capable as some of the JetBrains products out there. In this article, I'll walk you thro... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-configure-visual-studio-code-for-python-development/</link>
                <guid isPermaLink="false">66b0ab347cd8dca6718a22b6</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Farhan Hasin Chowdhury ]]>
                </dc:creator>
                <pubDate>Mon, 17 Jul 2023 17:13:01 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/10/visual-studio-code-for-python.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Visual Studio Code is one of the most versatile code editors out there. Even though it's a code editor, the sheer extensibility of the program makes it almost as capable as some of the JetBrains products out there.</p>
<p>In this article, I'll walk you through the entire process of configuring Visual Studio Code for Python development. It's not a universal setup, but this is something that I use personally and have found it to be really comfortable.</p>
<p>The first step is to install Visual Studio Code on your computer. I'm on Debian 12 at the moment and I have the editor ready to go. Platform specific <a target="_blank" href="https://code.visualstudio.com/docs/setup/setup-overview">installation instructions</a> are available in the documentation.</p>
<p>Assuming you are past the installation step, now I'll introduce you to a set of essential extensions that will elevate your Python development experience to the next level.</p>
<h2 id="heading-python-extension">Python Extension</h2>
<p>The first extension that you need to install is the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Python Extension</a> from Microsoft.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-86.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=ms-python.python</em></p>
<p>This is actually an extension pack that contains two extensions. The first extension is the Python extension. It lays the foundation for Python development in Visual Studio Code.</p>
<p>The other one is <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance">Pylance</a>, which is a very performant language server for Python.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-88.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance</em></p>
<p>This extension provides rich intellisense support and is powered by <a target="_blank" href="https://github.com/microsoft/pyright">Pyright</a>, the static type checker from Microsoft. The next thing you need to think about is linting.</p>
<h2 id="heading-ruff-linter">Ruff Linter</h2>
<p>A linter is a program that analyses your code statically and provides valuable insights on possible errors.</p>
<p>The Pylance extension does an excellent job of finding out fatal errors within your code, but there is more to code than just that.</p>
<p>When working on a big project, it's pretty common to leave unwanted mess within your codebase. Things like unused imports and variables, bad code practices, and so on.</p>
<p>A good linter can point out code smells like this and make your code cleaner. Now, the go-to choice when it comes to Python linters is Pylint.</p>
<p>Pylint has been around for ages and works quite well, but I think there is a better alternative.</p>
<p>Ruff is an extremely fast Python linter written in Rust that imposes stricter linting rules than Pylint. The tool also has an <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff">official extension</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-89.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff</em></p>
<p>It's a plug n' play extension and doesn't require any additional configuration whatsoever. So once you have it installed, you're good to go.</p>
<h2 id="heading-isort">Isort</h2>
<p>Like a linter, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-python.isort">isort</a> is another utility that's sole purpose is sorting import statements.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-95.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=ms-python.isort</em></p>
<p>The utility sorts all the imports alphabetically, while also dividing them into sections.</p>
<p>The extension is very straightforward. Once you have the extension, it'll render squiggly lines under any import statement that seems out of place.</p>
<p>You can then use the quick action menu to sort them. Or, you can also use the command palette to quickly access the isort command.</p>
<h2 id="heading-mypy-type-checker">Mypy Type Checker</h2>
<p>Before I start talking about this extension, let me explain what <a target="_blank" href="https://mypy-lang.org/">mypy</a> actually is.</p>
<p>According to the info on their homepage:</p>
<blockquote>
<p>Mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing. Mypy combines the expressive power and convenience of Python with a powerful type system and compile-time type checking.</p>
</blockquote>
<p>In simpler words, mypy forces you to add essential type annotations to your Python programs, making them easier to comprehend.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-90.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://mypy-lang.org/</em></p>
<p>Recently, Microsoft has published <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker">an extension</a> that adds type checking functionality using mypy to their beloved editor.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-91.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker</em></p>
<p>Once you have installed the extension, it'll perform necessary checks on your code and report any missing type annotations as compile-time errors.</p>
<p>While having type annotations is not mandatory, it's highly recommended.</p>
<h2 id="heading-intellicode">IntelliCode</h2>
<p><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode">IntelliCode</a> provides AI assisted code completion in Visual Studio Code. It may sound similar to GitHub Copilot, but in reality it's a lot smaller than that.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-93.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode</em></p>
<p>Where GitHub Copilot or Tabnine provides full-blown code blocks, IntelliCode autocompletes lines of code pretty flawlessly.</p>
<p>In most cases, this extension can help you type less of the same code by suggesting the right thing while also keeping out of your way.</p>
<h2 id="heading-error-lens">Error Lens</h2>
<p>While not related to Python specifically, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens">Error Lens</a> is a great extension that embeds errors right by the side of the line of code.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-94.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>I often work on my 14 inch Thinkpad and like to turn off the terminal pane. Error Lens eradicates the need to look at the terminal now and then to see my errors and warnings.</p>
<p>As useful as it may be, sometimes your editor can look cluttered due to all the warning and error outputs, so decide accordingly.</p>
<h2 id="heading-indent-rainbow">Indent Rainbow</h2>
<p>Unlike other programming languages, an incorrect level of indentation can literally break your program in Python.</p>
<p>Visual Studio Code already does a good job of visualizing indentation levels within your code, but if you want to add some color to it, the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow">indent-rainbow</a> package is what you need.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/07/image-92.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow</em></p>
<p>It adds different colors to the different levels of indentation. Personally, I don't use this one on a regular basis, but you may find it useful.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Like I said, these extensions and my personal configuration are not a silver bullet. But this setup is something that I've been using for quite a while and I hope it's useful to you as well.</p>
<p>I often install specialized extensions depending on the projects I work on. For example, I use the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=batisteo.vscode-django">Django</a> or <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=wholroyd.jinja">Jinja</a> project when I work on a Django or Flask project.</p>
<p>Or I install the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter">Jupyter</a> extension while working on a Jupyter Notebook. So feel free to install whatever you need, just don't overdo it.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Visual Studio vs Visual Studio Code – What's The Difference Between These IDE Code Editors? ]]>
                </title>
                <description>
                    <![CDATA[ The first time I heard about “Visual Studio”, I thought it was the same as “Visual Studio Code”. I don’t know why Microsoft decided to confuse everyone with the names of those two development tools. But that’s a story for another day. “Visual Studio”... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/visual-studio-vs-visual-studio-code/</link>
                <guid isPermaLink="false">66adf24611a28b6eb378d2cd</guid>
                
                    <category>
                        <![CDATA[ editor ]]>
                    </category>
                
                    <category>
                        <![CDATA[ rich text editor ]]>
                    </category>
                
                    <category>
                        <![CDATA[ visual studio ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Tue, 31 Jan 2023 19:17:31 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/01/VSvVSC.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The first time I heard about “Visual Studio”, I thought it was the same as “Visual Studio Code”. I don’t know why Microsoft decided to confuse everyone with the names of those two development tools. But that’s a story for another day.</p>
<p>“Visual Studio” and “Visual Studio Code” are not the same thing. Visual Studio is an integrated development environment (IDE) and Visual Studio Code is a rich text editor like Sublime Text and Atom.</p>
<p>But the difference between the tools is more than just IDE and text editor. </p>
<p>An IDE is a robust tool for writing, editing, debugging, and running your code. A text editor only lets you write and edit your code. You might have to step out of a text editor to run your code or download plugins to help it do the running for you.</p>
<p>In this article, you'll learn the main differences between Visual Studio and Visual Studio Code. But firstly, we need to know what “Visual Studio” is and what “Visual Studio Code is” before diving into those differences. </p>
<h2 id="heading-what-well-cover">What We'll Cover</h2>
<ul>
<li><a class="post-section-overview" href="#heading-what-is-visual-studio">What is Visual Studio?</a></li>
<li><a class="post-section-overview" href="#heading-what-is-visual-studio-code">What is Visual Studio Code?</a></li>
<li><a class="post-section-overview" href="#heading-what-is-the-difference-between-visual-studio-and-visual-studio-code">What is the Difference between “Visual Studio” and “Visual Studio Code”?</a></li>
<li><a class="post-section-overview" href="#heading-which-should-you-choose-between-visual-studio-and-visual-studio-code">Which should you Choose between “Visual Studio” and “Visual Studio Code”?</a></li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ul>
<h2 id="heading-what-is-visual-studio">What is Visual Studio?</h2>
<p>Visual Studio was first released in 1997 by Microsoft. It's an integrated development environment (IDE) for developing, editing, and debugging websites, web, and mobile applications as well as cloud services. </p>
<p>Because it's an IDE, programming utilities like a debugger, compiler, intellisence, and more are all bundled into it for you.</p>
<p>Visual Studio comes with built-in support for C# and .NET. It also supports other programming languages like C, C++, Python, F#, web languages (HTML, CSS, JavaScript), and a lot more. Support for Java was removed back in Visual Studio 2017.</p>
<p>Visual Studio runs on Windows and Mac. It has 3 editions – community, professional, and enterprise. The community version is free, while the professional and enterprise are not.</p>
<p>The installation is quite a bit more robust on Windows than Mac. So, on Windows, you might have to download more than 42 GB depending on what you want to do.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/Screenshot-2023-01-31-122422.png" alt="Screenshot-2023-01-31-122422" width="600" height="400" loading="lazy"></p>
<p>But on Mac, as of the time of writing this article, you need around 6.2 GB of disk space.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/Screenshot-2023-01-31-at-11.30.22.png" alt="Screenshot-2023-01-31-at-11.30.22" width="600" height="400" loading="lazy"> </p>
<h2 id="heading-what-is-visual-studio-code">What is Visual Studio Code?</h2>
<p>Visual Studio Code (also called VS Code) is like the mini version of Visual Studio. It is an open-source and lightweight text editor available on Windows, Mac, and Linux. There’s also the web version available at <code>https://vscode.dev/</code>.</p>
<p>VS Code comes with built-in support for JavaScript, TypeScript and Node JS, but you can use it to code in any language you want. All you need to do is download the relevant extensions. </p>
<p>Some of the extensions are made by Microsoft, but a lot of others are third-party extensions.</p>
<p>Unlike Visual Studio, you don’t need much space to download VS Code. You might not need more than 200 MB of disk space to download it. </p>
<p>Since it supports JavaScript, TypeScript, and Node JS by default, you get a debugger and intellisence, too. But to get intellisence, a compiler, and debuggers for other languages, you have to download relevant extensions.</p>
<p>Now you know that Visual Studio is an IDE and Visual Studio Code is a text editor. So let's summarize their main differences next.</p>
<h2 id="heading-what-is-the-difference-between-visual-studio-and-visual-studio-code">What is the Difference between “Visual Studio” and “Visual Studio Code”?</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Basis</strong></td><td><strong>Visual Studio</strong></td><td><strong>Visual Studio Code</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Type</strong></td><td>Visual Studio is a full-fledged IDE</td><td>VS Code is a text editor (AKA Code editor)</td></tr>
<tr>
<td><strong>Platform</strong></td><td>Visual Studio runs on Windows and Mac</td><td>VS Code runs on Windows, Mac, and Linux</td></tr>
<tr>
<td><strong>Size</strong></td><td>Visual Studio is relatively large. You might have to download more than 40 GB on Windows and over 6 GB on Mac</td><td>VS Code does not require more than 200 MB on any platform</td></tr>
<tr>
<td><strong>Support</strong></td><td>Visual Studio has built in support for C# and .NET, alongside several common languages apart from Java</td><td>VS Code supports JavaScript, Typescript, and Node JS out of the box. It also supports other programming languages – as long as there’s an extension(s) for that</td></tr>
<tr>
<td><strong>Pricing</strong></td><td>Visual Studio Community Edition is free, but the professional and enterprise editions code $45 and $250 per month respectively.</td><td>VS Code is free. Most of the extensions are also free but there are freemium ones</td></tr>
<tr>
<td><strong>Extensions</strong></td><td>Visual Studio does not have as many extensions as VS Code</td><td>VS Code has numerous professionally and curated extensions for various purposes</td></tr>
</tbody>
</table>
</div><h2 id="heading-which-should-you-choose-between-visual-studio-and-visual-studio-code">Which should you Choose between “Visual Studio” and “Visual Studio Code”?</h2>
<p>There has been a long-running debate about which is better and which to choose between Visual Studio and Visual Studio Code. Well, it depends on what you are doing.</p>
<p>If you’re developing exclusively with a language supported by Visual Studio such as C#, C, C++, Python, and others, Visual Studio or other relevant IDEs are likely the best option for you. </p>
<p>But even if you’re developing in those languages but you require a React, Vue, or Angular frontend, VS code might be the best option for you.</p>
<p>If you’re working in a team, they might provide you with the enterprise version of Visual Studio, or any other IDE that correlates with the language you are working with. For example, PyCharm for Python and IntelliJ Idea for Java.</p>
<p>If you’re using Linux, you have to choose Visual Studio Code or some other IDE apart from Visual Studio. That’s because Visual Studio does not run on Linux.</p>
<p>If you’re the kind of person that likes to customize your editor to your taste, just go for VS Code because it's highly customizable. You also should probably choose VS Code if you are mixing technologies.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This article showed you the differences between Visual Studio and VS Code, and also what they both are separately.</p>
<p>The debate should never be which one is better than the other, but which is best for what you want to do, or what you need. That’s why we looked at some scenarios that might encourage you to choose one over the other.</p>
<p>Thank you for reading.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Write And Run C and C++ Code in Visual Studio Code ]]>
                </title>
                <description>
                    <![CDATA[ Visual Studio Code (or VS Code for short) is a very common and widely used text editor and IDE (Integrated Development Environment). You can make VS Code very powerful like an IDE using a lot of extensions. Before approaching the process of running y... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-write-and-run-c-cpp-code-on-visual-studio-code/</link>
                <guid isPermaLink="false">66b9030605ed142b6e64c273</guid>
                
                    <category>
                        <![CDATA[ C++ ]]>
                    </category>
                
                    <category>
                        <![CDATA[ c programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ compilers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Fri, 20 Jan 2023 21:45:48 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/01/asd.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Visual Studio Code (or VS Code for short) is a very common and widely used text editor and IDE (Integrated Development Environment). You can make VS Code very powerful like an IDE using a lot of extensions.</p>
<p>Before approaching the process of running your first C or C++ code on Visual Studio Code, let me guide you through the process and get it all set up based on the operating system you are using on your computer.</p>
<h2 id="heading-c-and-c-compilers">C and C++ compilers</h2>
<p>For running C or C++ code, you just need to have a valid C/C++ compiler installed on your computer. If you are using a Linux operating system, then there is a high chance that it is already installed on your system. But we need to make sure that it is correctly installed.</p>
<p>For checking whether or not you have the compiler (GCC/G++/MinGW) installed on your system or not, you have to check the compiler version first. </p>
<p>Simply open your terminal and use <code>gcc --version</code> and <code>g++ --version</code>. If you get the version number, then the compiler is already installed on your system. </p>
<p>You can check the version using the same commands on any operating system, whether that is a Windows, Linux, or macOS-based operating system. </p>
<p>If you get feedback on your terminal that it does not know anything about GCC or G++, then you have to install the compiler correctly. </p>
<p>If you are using the most used Windows operating system, then I already have written an in-depth article showing you all the processes step-by-step on freeCodeCamp. Make sure to read the entire article first, as it also contains a complete video to provide you with complete support.</p>
<p><a target="_blank" href="https://www.freecodecamp.org/news/how-to-install-c-and-cpp-compiler-on-windows/">Embedded content</a></p>
<p>If you are using another operating system, and you don't have the compilers installed, then make sure to install them before proceeding.</p>
<h2 id="heading-how-to-install-vs-code-or-vs-code-insiders">How to Install VS Code or VS Code Insiders</h2>
<p>You have to download Visual Studio Code directly from the official website: <a target="_blank" href="https://code.visualstudio.com/">https://code.visualstudio.com/</a>.</p>
<p>If you want, you can also install VS Code Insiders, and the same process is applicable for that as well. </p>
<p>Visual Studio Code Insiders is actually the "Insiders" build of Visual Studio Code, which contains all the latest features that are shipped daily. You can think of VS Code as the stable release and the VS Code Insiders as the Insiders release of that.</p>
<p>If you want to experience the latest updates instantly, then you might also try Visual Studio Code Insiders (I use it myself). For downloading VS Code Insiders, you can visit the official website for VS Code Insiders here: <a target="_blank" href="https://code.visualstudio.com/insiders/">https://code.visualstudio.com/insiders/</a></p>
<p>Make sure to download the exact file for your operating system.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-163.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Download Page: VS Code</strong></em></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-164.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Download Page: VS Code Insiders</strong></em></p>
<p>The installation process is pretty basic. But I am going to show you all the steps sequentially. For now, I am going to show you the installation process using VS Code Insiders, but everything you will see here is going to be exactly the same for VS Code as well.</p>
<p>Make sure to click the box on the "I accept the agreement " box and click on <strong>Next</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-165.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Accept the agreement and click Next</strong></em></p>
<p>Keep everything as it is. Do not change anything from here.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-168.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Click Next</strong></em></p>
<p> Click <strong>Next</strong>. Again, simply click <strong>Next</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-170.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Click Next</strong></em></p>
<p>Make sure to add the checkmark (✔) on all of the boxes. Then click on <strong>Next</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-171.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Check all of the boxes, and click Next</strong></em></p>
<p>Click on <strong>Install</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-172.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Click Install</strong></em></p>
<p>It might take a little time to finish the installation.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-173.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Let it finish...</strong></em></p>
<p>Click on <strong>Finish</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-175.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Click Finish</strong></em></p>
<p>Congrats - you've successfully installed VS Code/VS Code Insiders on your system. Now, cheers! 🥂</p>
<h2 id="heading-how-to-prepare-vs-codevs-code-insiders-for-c-and-c-code">How to Prepare VS Code/VS Code Insiders For C and C++ Code</h2>
<p>First, open VS Code or VS Code Insiders.</p>
<p>Go to the Extension tab. Search for "C" or "C++" and install the first one that is already verified by Microsoft itself.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-178.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Install C/C++ extension</strong></em></p>
<p>Also, install <strong>C/C++ Extension Pack</strong>. It should also be verified by Microsoft.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-179.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Install C/C++ Extension Pack</strong></em></p>
<p>Then you have to search for <strong>Code Runner</strong> and install the extension as well.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-180.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Install Code Runner Extension</strong></em></p>
<p>Now, we need to change some settings.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-177.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Change some settings</strong></em></p>
<p>Click the <strong>gear</strong> box (It is called the Manage section), and then click <strong>Settings</strong>. Alternatively, you can also use the shortcut keys <code>Ctrl</code> + <code>,</code>. You need to replace the <code>Ctrl</code> key with the Command key for Mac.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-182.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Type "Run code in terminal" and press Enter key</strong></em></p>
<p>In the search bar, type "Run code in terminal" and press the Enter key.</p>
<p>Scroll down a little bit until you find <code>Code-runner: Run In Terminal</code>. Make sure that the box is checked (✔).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-184.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>Make sure to check the box</strong></em></p>
<p>Now you need to restart your VS Code/VS Code Insiders. Simply close and reopen the program.</p>
<h2 id="heading-how-to-test-your-code">How to Test Your Code</h2>
<p>Simply open VS Code/VS Code Insiders, open any folder, and create any file with the extension <code>.c</code> for the C file and <code>.cpp</code> for the C++ file. </p>
<p>After writing your code, you can run the code directly using the play button you'll find in the upper right corner.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/01/image-185.png" alt="Image" width="600" height="400" loading="lazy">
<em><strong>This is how you can run any C/C++ program from VS Code/Insiders</strong></em></p>
<p>It will compile and then run the code directly. After running a code, the code runner button would be set default to run directly. So, your computer is 100% ready for compiling and running any C/C++ programming code.  😀</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thanks for reading the entire article. If it helps you then you can also check out other articles of mine at <a target="_blank" href="https://www.freecodecamp.org/news/author/fahimbinamin/">freeCodeCamp</a>.</p>
<p>If you want to get in touch with me, then you can do so using <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter</a>, <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>, and <a target="_blank" href="https://github.com/FahimFBA">GitHub</a>. </p>
<p>You can also <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">SUBSCRIBE to my YouTube channel</a> (Code With FahimFBA) if you want to learn various kinds of programming languages with a lot of practical examples regularly.</p>
<p>If you want to check out my highlights, then you can do so at my <a target="_blank" href="https://www.polywork.com/fahimbinamin">Polywork timeline</a>.</p>
<p>You can also <a target="_blank" href="https://fahimbinamin.com/">visit my website</a> to learn more about me and what I'm working on.</p>
<p>Thanks a bunch!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up VSCode for Your React Projects ]]>
                </title>
                <description>
                    <![CDATA[ The ultimate tool you have when you're developing your projects is your code editor. Which is why it's so important to set it up properly. In this step-by-step guide, we will go from a completely new VSCode installation to a code editor perfectly pre... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/vscode-react-setup/</link>
                <guid isPermaLink="false">66d03801386d35c4e3bb3c2b</guid>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ React ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Reed ]]>
                </dc:creator>
                <pubDate>Thu, 17 Feb 2022 16:54:36 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/02/setup-vscode-for-react-projects.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The ultimate tool you have when you're developing your projects is your code editor. Which is why it's so important to set it up properly.</p>
<p>In this step-by-step guide, we will go from a completely new VSCode installation to a code editor perfectly prepared for your next React project.</p>
<p>Let's get started!</p>
<h2 id="heading-how-to-install-vscode">How to Install VSCode</h2>
<p>The first step to setting up Visual Studio Code (VSCode for short) is to install it for your computer.</p>
<p>Head to <a target="_blank" href="https://code.visualstudio.com">code.visualstudio.com</a> and download the right version for your computer (it's 100% free).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.08.06-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Install the right version for your operating system</em></p>
<p>Once your installation is done and you open the VSCode app, you should be greeted with a home screen that looks something like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.19.32-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>VSCode Home Screen (After Install)</em></p>
<h2 id="heading-choose-a-color-theme-you-like">Choose a color theme you like</h2>
<p>Although the default theme that ships with VSCode is very nice and legible, I prefer to use a third-party theme that I find easier on my eyes.</p>
<p>It might seem like a trivial thing to spend time picking a theme. But since you will be spending hours reading text on your editor, you want to choose colors that you like and that do not strain your eyes.</p>
<p>I personally use and highly recommend the Material Theme for all of my installations of VSCode.</p>
<p>To install the Material Theme, go to (at the top of the screen):</p>
<p><strong>View</strong> &gt; <strong>Extensions</strong> (or use the shortcut ⇧ + ⌘ (Ctrl) + X)</p>
<p>Then search for "Material Theme" in the sidebar and install the first result that comes up. </p>
<p>It should look like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.36.24-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Material Theme Installation</em></p>
<p>Once it has been installed it will give you a dropdown to choose between a bunch of different variants.</p>
<p>The default option is great, but I personally find the "Material Theme Ocean High Contrast" variant to be the best looking.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.37.38-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Material Theme for VSCode</em></p>
<h2 id="heading-make-your-text-easy-to-read">Make your text easy to read</h2>
<p>Now is a good time to add some basic settings that make the code that you write comfortable to read.</p>
<p>Settings that will improve the readability of your code are your font size, tab size, and font family.</p>
<p>You can change your VSCode preferences by going to (at the top of your screen):</p>
<p><strong>Code</strong> &gt; <strong>Preferences</strong> &gt; <strong>Settings</strong> (or use the shortcut: ⌘ (Ctrl) + ,)</p>
<p>The settings I have found to most comfortable over the years for both desktop and laptop development are font size of 18 and a tab size set to 2.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.27.06-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Text Settings for VSCode</em></p>
<p>Additionally, to get your text looking just right, I find text looks better when you increase the default zoom level of the editor.</p>
<p>To increase the zoom level, go to preferences (⌘ (Ctrl) + ,) and type in "<strong>zoom level</strong>".</p>
<p>I recommend changing the zoom level from 0 to 1.</p>
<p>And finally, as a matter of preference, I like to remove the default breadcrumb links that are at the top of the editor.</p>
<p>You can remove breadcrumbs by going to:</p>
<p><strong>View</strong> &gt; <strong>Show Breadcrumbs</strong> (and making sure it is unchecked).</p>
<p>Here is what our code editor looks like with a sample component file I added to my Desktop:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.49.42-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>React component appearance in VSCode</em></p>
<h2 id="heading-format-your-code-with-the-prettier-extension">Format your code with the Prettier extension</h2>
<p>You might have noticed in the example above that the code isn't very nicely formatted.</p>
<p>Fortunately, you can automatically format every .js file you write using the Prettier extension for VSCode.</p>
<p>To be able to instantly format our code every time we save a .js file, we can again go to the extensions tab (⇧ + ⌘ (Ctrl) + X), type in "<strong>prettier</strong>" and install it:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.51.35-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Prettier extension for VSCode</em></p>
<p>Next, we can go back to preferences (⌘ (Ctrl) + ,) and search for "<strong>format on save</strong>" and make sure it is checked:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.53.36-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Format on Save setting</em></p>
<p>And again in preferences, search for the "<strong>default formatter</strong>" setting and set it to Prettier.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.55.30-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Default formatter setting</em></p>
<p>Now if we go back to an unformatted file and hit save, it will instantly be formatted for us!</p>
<p>Here is what our dummy component now looks like after we hit save:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-10.57.23-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Formatted React component (with Prettier)</em></p>
<p>Check out the Prettier extension documentation to see how you can further configure it according to your formatting preferences. Still, I personally recommend using the default options</p>
<h2 id="heading-how-to-quickly-type-jsx-with-emmet">How to Quickly type JSX with Emmet</h2>
<p>VSCode comes with built-in support for an amazing tool called Emmet that allows you to write HTML tags very quickly.</p>
<p>However, Emmet is not configured by default to be used with JSX, which React uses instead of HTML.</p>
<p>To write your JSX more quickly, you can use Emmet with React by going to:</p>
<p><strong>Code</strong> &gt; <strong>Preferences</strong> &gt; <strong>Settings</strong> (⌘ (Ctrl) + ,)</p>
<p>And then typing in the search bar, "<strong>emmet include languages</strong>".</p>
<p>After that, click the "Add Item" button and add the following setting:</p>
<p>item: <strong>javascript</strong>, value: <strong>javascriptreact</strong> (and then hit ok)</p>
<p>Your added setting should look like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/Screen-Shot-2022-02-17-at-11.10.32-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Emmet Include Languages setting</em></p>
<p>Now that we have included React as a language for Emmet, we can start writing our JSX much more quickly.</p>
<p>Here is quick demo of how productive you can be with Emmet:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/02/emmet-react.gif" alt="Image" width="600" height="400" loading="lazy">
<em>Quick demo of Emmet shortcuts</em></p>
<h2 id="heading-become-a-professional-react-developer">Become a Professional React Developer</h2>
<p>React is hard. You shouldn't have to figure it out yourself.</p>
<p>I've put everything I know about React into a single course, to help you reach your goals in record time:</p>
<p><a target="_blank" href="https://www.thereactbootcamp.com"><strong>Introducing: The React Bootcamp</strong></a></p>
<p><strong>It’s the one course I wish I had when I started learning React.</strong></p>
<p>Click below to try the React Bootcamp for yourself:</p>
<p><a target="_blank" href="https://www.thereactbootcamp.com"><img src="https://reedbarger.nyc3.digitaloceanspaces.com/reactbootcamp/react-bootcamp-cta-alt.png" alt="Click to join the React Bootcamp" width="600" height="400" loading="lazy"></a>
<em>Click to get started</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Open Visual Studio Code From Your Terminal ]]>
                </title>
                <description>
                    <![CDATA[ By Madison Kanna In this tutorial, we'll go over how you can open the VS Code text editor (Visual Studio Code) from your Mac terminal.  Opening your text editor from your terminal is a quick, easy way to open up new projects and begin coding faster. ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-open-visual-studio-code-from-your-terminal/</link>
                <guid isPermaLink="false">66d8518ae0db794d56c01beb</guid>
                
                    <category>
                        <![CDATA[ editor ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 04 Jan 2022 21:13:11 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/01/code.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Madison Kanna</p>
<p>In this tutorial, we'll go over how you can open the VS Code text editor (Visual Studio Code) from your Mac terminal. </p>
<p>Opening your text editor from your terminal is a quick, easy way to open up new projects and begin coding faster. </p>
<h2 id="heading-how-to-download-and-open-vs-code">How to Download and Open VS Code</h2>
<p>The first thing you'll need to do is open up VS Code. If you don't have VS Code yet, you can download it <a target="_blank" href="https://code.visualstudio.com/">here</a>. VS Code is a popular text editor created by Microsoft. </p>
<p>Once you have VS Code open, it should look like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/01/image.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Next, run <code>Command + Shift + P</code>. </p>
<p>Now you should see this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/01/image-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>What we've done here is opened up the VS Code command palette. This will allow you to customize your VS Code settings, among other things.</p>
<p>Next, into the command palette type <code>shell</code> and hit <code>enter</code>. When you type <code>shell</code>, your editor should look like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/01/image-2.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Once you hit enter, voilà! You're all done. You should now see a success message:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/01/image-3.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now you can open VS Code from your terminal. Let's do this now.</p>
<h2 id="heading-how-to-open-vs-code-from-the-terminal">How to Open VS Code from the Terminal</h2>
<p>First, open up your terminal. You can open your terminal in a few ways. One way of opening your terminal is hitting the <code>command</code> button and the <code>spacebar</code> at the same time. This opens spotlight search. From here, you can type "terminal". </p>
<p>Once your terminal is open, you can open VS Code from it by typing <code>$ code .</code> Then hit <code>enter</code>.</p>
<p>Here's how this should look: </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/01/image-4.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Once you hit <code>enter</code>, VS Code will now open. </p>
<p>And there you have it! Happy coding. :)</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Use Google Colab with VS Code ]]>
                </title>
                <description>
                    <![CDATA[ By Davis David Google Colab and VS Code are two popular editor tools that many Python developers use. They're great for developing efficient tech solutions or systems especially in the areas of Machine Learning and Data Science. If you're a Python de... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-google-colab-with-vs-code/</link>
                <guid isPermaLink="false">66d84ebbaeb1c87b6855d3dc</guid>
                
                    <category>
                        <![CDATA[ Google Colab ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 09 Aug 2021 22:24:53 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/08/1_6glvkHvmHFc9JjcExBB3-w.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Davis David</p>
<p>Google Colab and VS Code are two popular editor tools that many Python developers use. They're great for developing efficient tech solutions or systems especially in the areas of Machine Learning and Data Science.</p>
<p>If you're a Python developer or data scientist, you might already know how to use Google Colab. But did you know that you can set up VS Code on Google Colab and use it as an editor the same way as in your local machine?</p>
<p><strong>In this article, you will learn:</strong></p>
<ol>
<li>How to install the colabcode Python package.</li>
<li>How to start VS Code (code server).</li>
<li>How to access the online VS Code.</li>
<li>How to open the terminal.</li>
<li>How to run a Python file.</li>
</ol>
<h2 id="heading-how-to-use-google-colab-with-vs-code">How to Use Google Colab with VS Code</h2>
<h3 id="heading-open-colab-notebook">Open Colab Notebook</h3>
<p>The first step is to launch a new colab notebook in your Google Colab. You can rename the file as you want.</p>
<p>For example, <code>run_vscode.ipynb</code>.</p>
<h3 id="heading-install-colabcode-python-package">Install colabcode Python package.</h3>
<p>To use Google Colab with VS Code (code server), you need to install the colabcode Python package. This is an awesome open-source Python package developed by <a target="_blank" href="https://github.com/abhishekkrthakur">Abhishek Thakur</a>.</p>
<p>To install the package, run the following command in your notebook cell:</p>
<pre><code> !pip install colabcode
</code></pre><h3 id="heading-import-colabcode">Import ColabCode</h3>
<p>The next step is to import the ColabCode class from the package.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> colabcode <span class="hljs-keyword">import</span> ColabCode
</code></pre>
<h3 id="heading-create-an-instance-of-colabcode">Create an instance of ColabCode</h3>
<p>After importing ColabCode, you need to create an instance of ColabCode and set the following arguments:</p>
<ul>
<li><strong>port</strong> – The port you want to run the code-server on. For example port=10000</li>
<li><strong>password</strong> – You can set a password to protect your code-server from unauthorized access. This is an optional argument.</li>
<li><strong>mount_drive</strong> – If you want to use your Google drive. This is a Boolean argument which means you can set it to True or False. This is an optional argument.</li>
</ul>
<pre><code class="lang-python">ColabCode(port=<span class="hljs-number">10000</span>)
</code></pre>
<h3 id="heading-start-the-code-server">Start the Code Server</h3>
<p>After running the ColabCode instance, it will start the server and show the link to access the code server.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/1_2j1llmzWvkrJ1QcDX4TyKw.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You need to click the link and it will open in a new tab.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/1_8WOTEo4531S7KEoE9qsocA.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now you can take advantage of a full-fledged code editor and run different experiments on the Colab VM.</p>
<p><strong>Note:</strong> If you check on your Colab Notebook, you will see that the cell that runs the ColabCode instance is continuously running. Don't close your Colab notebook unless you want to close the code server that runs VS Code.</p>
<h2 id="heading-tips-to-use-vs-code-on-google-colab">Tips to use VS Code on Google Colab</h2>
<p>After launching the code server, use the following tips to help you start using VS Code on Google Colab.</p>
<h3 id="heading-step-1-open-terminal">Step 1: Open Terminal</h3>
<p>To open the terminal on VS Code that runs on Google Colab, use the following shortcut command:</p>
<pre><code class="lang-command">Ctrl + Shift + `
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/1_LdynqUTdluFY53C3DwIfdg.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-2-change-the-theme-if-you-want">Step 2: Change the Theme if You Want</h3>
<p>You can change the theme of the editor by clicking the setting icon (bottom-left corner) and then click "Color Theme". It will open a popup window with different theme options you can select.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/1_oRbVQGlo1juU6yh4ylOIwQ.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-3-run-a-python-file">Step 3: Run a Python File</h3>
<p>You can create a Python file by clicking the <strong>"File"</strong> section on the sidebar and then select a <strong>"New File"</strong> tab.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/1_8YC-QStbIB9sdzh3gV5krg-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>In the following example, you will see how to run a simple Python file that trains a machine-learning algorithm to classify iris flowers into three species (setosa, versicolor, or virginica) and then make a prediction.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/08/1_C21tD_JDFE6dh559nCmZ0Q-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-final-thoughts-on-using-google-colab-with-vs-code">Final Thoughts on Using Google Colab with VS Code</h2>
<p>Congratulations 👏👏, you have made it to the end of this article! I hope you have learned something new. You can set up VS Code on Google Colab and take your coding to the next level.</p>
<p>You can also use the colabcode Python package on the <strong>Kaggle</strong> platform to run VS Code. You just need to follow the same steps mentioned above.</p>
<p>If you learned something new or enjoyed reading this article, please share it so that others can see it. Until then, see you in the next post!</p>
<p>You can also find me on Twitter <a target="_blank" href="https://twitter.com/Davis_McDavid">@Davis_McDavid</a>.</p>
<p>And you can read more articles like this <a target="_blank" href="https://hackernoon.com/u/davisdavid">here</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Open Any Repo in VS Code Without Cloning It ]]>
                </title>
                <description>
                    <![CDATA[ By Burke Holland You can now open anything (that you have access to) on GitHub directly from VS Code with the official Remote Repositories extension.  And I do mean directly. That means no clone. No download. No looking at your dev folder and wonderi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/you-can-now-edit-anything-on-github-in-vs-code-without-cloning/</link>
                <guid isPermaLink="false">66d45de6182810487e0ce112</guid>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 15 Jun 2021 16:06:54 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/06/window.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Burke Holland</p>
<p>You can now open anything (that you have access to) on GitHub directly from VS Code with the official <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub&amp;WT.mc_id=devcloud-18509-cxa">Remote Repositories extension</a>. </p>
<p>And I do mean <em>directly</em>. That means no clone. No download. No looking at your dev folder and wondering why on earth you structured your projects this way and OMG SO MUCH REGRET.</p>
<p>Listen, it's ok. Nobody is happy with how they have cluttered up their once pristine dev environment. Inside my "c:\dev" folder is an entire season of <a target="_blank" href="https://www.aetv.com/shows/hoarders">Hoarders</a> and no, I'm not going to delete that jQuery project. I might need it some day.</p>
<p>Let's look at how the new Remote Repositories extension for VS Code lets you casually interact with any project on GitHub without having to clone a thing.</p>
<h2 id="heading-how-to-install-the-remote-repositories-extension">How to Install the Remote Repositories Extension</h2>
<p>First, you'll need to install GitHub's <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub&amp;WT.mc_id=devcloud-18509-cxa">Remote Repositories extension</a> for Visual Studio Code.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub&amp;WT.mc_id=devcloud-18509-cxa">https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub&amp;WT.mc_id=devcloud-18509-cxa</a></div>
<p>To open a GitHub repo, click on the green indicator in the lower left-hand corner of VS Code. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-64.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You'll see a new option for "Open Remote Repository". </p>
<p>If you have other Remote extensions for VS Code installed, you'll see a lot more options in this list, so just search for the right one. </p>
<p>You can also get to this option from the Command Palette if clicking on things with a mouse is too much trouble. I see you VIM people.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-65.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can paste in the URL to a GitHub repo if you happen to just have that hanging around on your clipboard (weird) OR you can browse GitHub by selecting "Open Repository from GitHub". The third option lets you open a Pull Request branch so you can pretend to thoroughly review it.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-66.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>VS Code will reopen and you'll see that repository just like you were working with it locally. But you're not. You're looking at it <em>on</em> GitHub <em>through</em> the window of VS Code.</p>
<p>You'll notice disclaimers about "some features" not being available and that you are in "Restricted Mode".</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-145.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This is part of the new Trusted Workspace settings in VS Code. </p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://code.visualstudio.com/docs/editor/workspace-trust?WT.mc_id=devcloud-30876-buhollan">https://code.visualstudio.com/docs/editor/workspace-trust?WT.mc_id=devcloud-30876-buhollan</a></div>
<p>By default, VS Code now turns off Tasks, debugging, some workspaces settings and any extensions that might try and execute something the first time you open a folder. You have to tell VS Code that it's cool, you know and trust this code and you're 100% sure it's not going to <a target="_blank" href="https://www.nytimes.com/2021/05/08/us/politics/cyberattack-colonial-pipeline.html">shutdown your oil pipeline</a>. </p>
<p>Ok – so scary security warnings dismissed, what can we do here?</p>
<h2 id="heading-how-to-work-with-a-remote-repository">How to Work with a Remote Repository</h2>
<p>You have full editing capabilities with a big difference being that you don't have to save anything. Your changes are just saved as you go. </p>
<p>They aren't automatically committed to GitHub. In order for the changes to be saved to the repo, you'd have to commit them from the source control view. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-68.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You don't have to push them because you are already on GitHub. A commit is a commit – no push required. This is the same as if you were editing the file directly on GitHub. Because you essentially are.</p>
<p>As far as the editing goes, you get much of what you would expect in  VS Code.</p>
<p>Language specific intellisense works. For instance, if  you started writing a <code>fetch</code>, VS Code will help you with that because it knows about <code>fetch</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-69.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>But you do not get the intellisense on project files that VS Code gives you when it runs your project locally. </p>
<p>For instance – locally, VS Code knows about <code>useEffect</code> which comes from the <code>react</code> import. It knows this because it's inspecting the import which is a node module. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-34.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>But with Remote Repositories, we're looking directly at GitHub and the node_modules folder never ever gets pushed to GitHub unless you are me 10 years ago. So there is no intellisense for <code>useEffect</code> because that code doesn't actually exist in the repo.</p>
<p>You can use things like Emmet to compose HTML and you get the nice split screen Markdown preview that you probably love like I do.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-35.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can also use "Find" and "Find in Files". </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-37.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Many things that work locally work the same way when connected to a project directly on GitHub, but some do not. Which is the vaguest thing anyone has ever written on the internet, but understanding how this all works will shed some light on what you can reasonably expect.</p>
<h2 id="heading-how-it-works">How It Works</h2>
<p>VS Code has a <a target="_blank" href="https://github.com/microsoft/vscode/blob/dc8bd9cd7e5231745549ac6218266c63271f48cd/src/vs/vscode.d.ts#L7038">file system provider API</a> that has been around for some time. What this API does is provide a mechanism to consume an API as if it were a physical file. In this case, the Remote Repositories extension is consuming and mapping the GitHub API to a "Virtual Workspace" in VS Code.</p>
<p>This means that any extension that is trying to work with physical files is not going to work <strong>until the</strong> <strong>extension author updates their extension to use the Virtual File System API</strong>. Which means that things that don't work today might work in the future as extensions are updated.</p>
<p>So what can you expect to work? Themes, key bindings, snippets and grammar extensions. These types of extension typically don't execute any code, so you know they aren't trying to work with files which means it's safe (internet safe) to assume they'll work in Remote Repositories.</p>
<p>But some things won't ever work because you need local file access to do them. </p>
<p>A prime example of this is Prettier. Prettier is a CLI tool that alters your local files by reformatting your code. Since there is no local file access, it doesn't currently work with Remote Repositories. So nobody is going to change those double quotes to singles automatically or put that semicolon back. Or remove it. I want out of this paragraph.</p>
<p>In fact, you can't <em>run</em> a Remote Repositories project at all. If you open the terminal while connected to a Remote Repository, it will be there. But it won't have any access to this project. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-70.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Which is legit because the project doesn't actually exist on your machine. So how do you get a terminal if you find you actually do want to run the code you are working with, or just upgrade your editing experience to full-blown VS Code?</p>
<h2 id="heading-how-to-switch-to-full-vs-code">How to Switch to Full VS Code</h2>
<blockquote>
<p>"Continue on my wayward son" - <a target="_blank" href="https://www.youtube.com/watch?v=2X_2IdybTV0">some band from the 70's</a></p>
</blockquote>
<p>If you click in that green bottom left-hand part of the Status Bar that says "GitHub" right now, you'll see an option to "Continue Working On".</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-71.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This option will let you either clone the project locally, or open it in a GitHub Codespace. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-72.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If you're in the Codespaces Beta (<em><a target="_blank" href="https://github.com/features/codespaces">request access here</a></em>), you can open the repo in a Codespace. This is VS Code running in the browser, but backed by a compute environment where you can run anything just like it was on your desktop. This works because VS Code was originally designed to be a web app. True story.</p>
<p>Or clone it locally! Crack open that <code>c:\Users\you\Documents\GitHub</code> folder that you regret choosing to put all  your projects in because now your "Documents" folder is being backed up to OneDrive and it's got 900 terabytes of node_modules in it. Well - now it's got 920. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/06/image-77.png" alt="Image" width="600" height="400" loading="lazy">
<em>Credit: Some brilliant soul. Please comment and take credit for this work of genius.</em></p>
<h2 id="heading-cool-but-why">Cool. But Why?</h2>
<p>The natural question you should be asking yourself right now is, "Very cool! But why do I need this?"</p>
<p>Excellent question. You are preceptive and people like you.</p>
<p>Consider the following scenarios...</p>
<ul>
<li><strong>You want to browse a GitHub repo and look at the code.</strong> GitHub is a great site, but it's not the best way to quickly jump through files and examine a project. You really need an editor for that and Remote Repositories cuts out the cumbersome and often bandwidth intensive step of cloning simply to look at code.</li>
<li><strong>You want to make a quick update.</strong> While you would almost always do heavy coding locally, you might want to pop into a repo and make a quick change without having to sync your local environment. README's come to mind, but this could be any sort of small change.</li>
<li><strong>You are working on Markdown.</strong> If you're working on documentation, README's or other Markdown in GitHub, there's no need to clone the repo locally anymore to do that. Unless you are running a local server to preview that Markdown, using the built-in preview is a much faster way to pound out 5K words about your API.</li>
<li><strong>You want to review a PR.</strong> Seems self explanatory. </li>
</ul>
<h2 id="heading-get-more-remote">Get More Remote</h2>
<p>Now that you have Remote Repositories, you can clean out that dev folder. Just right-click and delete something. See how good that feels? </p>
<p>Remote Repositories is one of several ways to do "Remote" development with VS Code. Check out these other options to use VS Code to connect to almost anything. </p>
<ul>
<li><a target="_blank" href="https://code.visualstudio.com/docs/remote/containers?WT.mc_id=devcloud-30876-buhollan">Dev Containers</a> - Use a Docker container as a full-featured development environment with </li>
<li><a target="_blank" href="https://code.visualstudio.com/docs/remote/ssh?WT.mc_id=devcloud-30876-buhollan">Remote SSH</a> - Open a remote folder in VS Code on any remote machine over an SSH connection</li>
<li><a target="_blank" href="https://code.visualstudio.com/docs/remote/wsl?WT.mc_id=devcloud-30876-buhollan">Remote WSL</a> - To use your WSL as the full-time backing runtime environment in VS Code.</li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ VS Code Performance – How to Optimize Visual Studio Code and Choose the "Best" Extensions ]]>
                </title>
                <description>
                    <![CDATA[ By Rob O'Leary Visual Studio Code (VS Code) is designed to be lightweight. It has a tight set of core features, and you can add extra features through extensions.   But performance will inevitably be affected as your collection of extensions grows.  ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/optimize-vscode-performance-best-extensions/</link>
                <guid isPermaLink="false">66d460c7d14641365a050961</guid>
                
                    <category>
                        <![CDATA[ editor ]]>
                    </category>
                
                    <category>
                        <![CDATA[ performance ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 19 Oct 2020 18:01:39 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/10/banner-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Rob O'Leary</p>
<p>Visual Studio Code (VS Code) is designed to be lightweight. It has a tight set of core features, and you can add extra features through extensions.  </p>
<p>But performance will inevitably be affected as your collection of extensions grows. </p>
<p>Do you evaluate the performance of an extension before installing it? What do you do if the startup of VS Code grows? From the absence of people writing about this topic, I guess people don't know.</p>
<p>In this article, I will explain the factors that affect the performance of an extension. I will also grade the performance of some popular extensions. Then I will outline how you can audit the performance of your existing extension suite, and give some general performance tips.</p>
<h2 id="heading-minimum-hardware-and-software-requirements">Minimum hardware and software requirements</h2>
<p>Before we get into extensions, let's talk briefly about what the minimum requirements for running VS Code are. </p>
<p>A computer bought in the last few years with modest specifications should be able to run VS Code without any issues. </p>
<h3 id="heading-hardware">Hardware</h3>
<p>The minimum hardware I recommend is:</p>
<ul>
<li>1.6 GHz or faster processor;</li>
<li>At least 1 GB of RAM;</li>
<li>At least 200MB Disk Space.</li>
</ul>
<h3 id="heading-operating-systems">Operating Systems</h3>
<p>VS Code has been tested on the following Operating Systems:</p>
<ul>
<li>OS X Yosemite and later.</li>
<li>Windows 7 (with .NET Framework 4.5.2), 8.0, 8.1 and 10 (32-bit and 64-bit).</li>
<li>Linux (Debian): Ubuntu Desktop 14.04, Debian 7.</li>
<li>Linux (Red Hat): Red Hat Enterprise Linux 7, CentOS 7, Fedora 23.</li>
</ul>
<h3 id="heading-unofficial-community-builds-for-raspberry-pi-and-chromebooks">Unofficial community builds for Raspberry Pi and Chromebooks</h3>
<p>Jay Rodgers released an open-source project that performs <a target="_blank" href="http://code.headmelted.com/">nightly builds of VS Code for Raspberry Pi  and Chromebooks</a>. </p>
<blockquote>
<p>I've maintained the project for a few years now and it has expanded from providing binaries for Pi to providing support and tools to get VS Code running on low-end ARM devices that might not otherwise support it like Chromebooks (which make up about 60% of the devices in schools now).  </p>
</blockquote>
<p>If you want to try it out for yourself, you can follow the instructions he has laid out. He's done a lot of work to make it as straightforward as possible. </p>
<h2 id="heading-not-all-extensions-are-created-equal">Not all extensions are created equal</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/blind-judgment.jpg" alt="extension inequality parody" width="600" height="400" loading="lazy">
<small>Edit of "Blindfolded Lady Justice" by <a target="_blank" href="https://unsplash.com/@tingeyinjurylawfirm?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tingey Injury Law Firm</a> on <a target="_blank" href="https://unsplash.com/s/photos/equal?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></small></p>
<p>Extensions are loaded and unloaded under different conditions. The author of the extension decides this. This is specified through <em>Activation Events</em>, which we will discuss later. </p>
<p>There is no feedback in the editor indicating if an extension is active or not. So how do we know when an extension is active?</p>
<p>Most extensions are written in TypeScript, but they can also be written in JavaScript. Extensions can include Node modules as dependencies. </p>
<p>You can bundle and minify your source files into a single file if you wish. The <a target="_blank" href="https://code.visualstudio.com/api/working-with-extensions/bundling-extension">VS Code Docs</a> recommends doing this to improve loading times, but many extensions don't do this. These choices affect their performance.</p>
<p>Extensions are mostly open source side projects written by developers. The quality of the code will vary. The maintenance of the code will vary. </p>
<p>Extensions written by Microsoft are not immune to these shortcomings, but they are less likely to suffer from them.</p>
<h2 id="heading-criteria-for-selecting-an-extension">Criteria for selecting an extension</h2>
<p>Most lists of extensions talk about the cool features, and little else. If something is fire, please tell me a bit about the fuel and fumes also. ?‍??</p>
<p>Some of the criteria that I suggest involves looking at source code. Don't be put off by that. To gather the key facts only takes a couple of minutes. I will show you how!</p>
<ol>
<li><p><strong>Is the feature I need available in VS Code already?</strong></p>
<p>I demonstrated that you don't need many popular extensions in an article <a target="_blank" href="https://roboleary.net/vscode/2020/08/05/dont-need-extensions.html">"VS Code: you don't need that extension"</a>. You can consult the <a target="_blank" href="https://code.visualstudio.com/Docs">VS Code docs</a> to check on a particular feature. </p>
</li>
<li><p><strong>Does the extension have the features I need?</strong></p>
<p>Consult the extension page on Visual Studio Marketplace to find this out.</p>
</li>
<li><p><strong>When is an extension loaded and active?</strong></p>
<p>I'll discuss this in detail in the section <a class="post-section-overview" href="#activation-events">Activation Events</a>. You need to check the <em>package.json</em> of the source code to find this out in advance. </p>
<p>You can run the <strong>Developer: Startup Performance</strong> command to see the Activation Events of installed extensions. I discuss this further in the section <a class="post-section-overview" href="#how-to-audit-performance">How to audit performance.</a> </p>
</li>
<li><p><strong>Are resources optimized?</strong>  </p>
<p>You need to check the source code to see if it uses a bundler. You can check the <em>package.json</em> to see if the <em>scripts</em> section has a pre-build step for bundling.</p>
<p>The VSIX extension file is a compressed archive of files for the code and the listing in the marketplace. Developers often include unnecessary files. There is a <em>.vscodeignore</em> file to exclude files. </p>
<p>The number of files that the VSIX contains has an impact on the cold activation time. The cold activation time is the first run of the extension after you install it. It tends to be slower than other times. I guess this is because the VSIX is uncompressed and cached. </p>
<p>This is what the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=octref.vetur">Vetur</a> extension looks like when you open it in <a target="_blank" href="https://www.7-zip.org/">7Zip</a>.</p>
</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/vetur-7zip.png" alt="vetur VSIX opened in 7zip" width="600" height="400" loading="lazy"></p>
<ol start="5">
<li><p><strong>Have there been any performance issues reported recently, which are unresolved?</strong></p>
<p>You can uncover these by auditing the performance of the extension. You need to check the issues on the Git repo also.</p>
</li>
<li><p><strong>Does the code have tests?</strong></p>
<p>The extension is going to be more susceptible to bugs without tests. You need to check the source code to see if there are tests.</p>
</li>
<li><p><strong>Is it actively maintained?</strong></p>
<p>The <em>Project Details</em> section of the extension page gives an overview of the activity of the public Git repo. In some cases, an extension may be "done", so maintenance is not an important consideration.</p>
</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/marketplace-maintenance.png" alt="Marktetplace Page Project Details" width="600" height="400" loading="lazy"></p>
<h2 id="heading-activation-events">Activation Events</h2>
<p>Activation Events are events that trigger the activation of an extension. They define the conditions for loading and unloading an extension.</p>
<p>The author of an extension declares this in the <code>activationEvents</code> field of the <code>package.json</code> (<a target="_blank" href="https://code.visualstudio.com/api/references/extension-manifest">Extension Manifest</a>). </p>
<p>There are a range of Activation Events to choose from. An extension can listen to many Activation Events to yield a more specific scope. </p>
<p>This is a Sequence Diagram of what happens when you launch VS Code. It gives you an idea of the chronology of events that occur, which affect when you can interact with the editor and use certain extensions.</p>
<p><a target="_blank" href="https://cdn.imgpaste.net/2020/10/19/IDOqm.png"><img src="https://www.freecodecamp.org/news/content/images/2020/10/activation-events-2.svg" alt="launching VS Code" width="600" height="400" loading="lazy"></a></p>
<p>Now, I will go through the most important Activation Events. I will start with the widest scope, and continue until I reach the narrowest scope. </p>
<h3 id="heading-startup-event">Startup event</h3>
<p>The <code>*</code> Activation Event will activate an extension when VS Code starts up.  These extensions will <strong>always be active</strong>. This impacts the startup time of VS Code.</p>
<pre><code class="lang-json"><span class="hljs-string">"activationEvents"</span>: [
    <span class="hljs-string">"*"</span>
]
</code></pre>
<p>The VS Code docs gives the following advice:</p>
<blockquote>
<p>To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case.</p>
</blockquote>
<p>In my opinion, there has to be a special case to grant an extension this scope. It is preferable to use at least <code>onStartUpFinished</code>.</p>
<p><strong>Popular Extensions with this Activation Event</strong>: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint">ES Lint</a> (11M installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">Live Server</a> (7.4 installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> (6.5M installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify">Beautify</a> (5.4M installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer">Bracket Pair Colorizer</a> (3.6M installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory">Git History</a> (2.9M installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync">Settings Sync</a> (2M installs), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow">indent-rainbow</a> (1.1M installs).</p>
<h3 id="heading-onstartupfinished-event">onStartupFinished event</h3>
<p>This extension will be activated <strong>sometime after VS Code starts up</strong>. This is like the <code>*</code> activation event, but it will not slow down VS Code's startup.</p>
<pre><code class="lang-json"><span class="hljs-string">"activationEvents"</span>: [
    <span class="hljs-string">"onStartupFinished"</span>
]
</code></pre>
<p><strong>Popular Extensions with this Activation Event</strong>: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier</a> (8.5M installs).</p>
<h3 id="heading-onlanguage-event">onLanguage event</h3>
<p>This extension will be activated whenever a file of a certain language is opened.</p>
<pre><code class="lang-json"><span class="hljs-string">"activationEvents"</span>: [
    <span class="hljs-string">"onLanguage:json"</span>,
    <span class="hljs-string">"onLanguage:markdown"</span>,
    <span class="hljs-string">"onLanguage:typescript"</span>
]
</code></pre>
<p>The <code>onLanguage</code> event takes a <a target="_blank" href="https://code.visualstudio.com/docs/languages/identifiers">language identifier</a> value. You can declare as many languages as you wish.</p>
<p><strong>Popular Extensions with this Activation Event</strong>: Most extensions in the <a target="_blank" href="https://marketplace.visualstudio.com/search?target=VSCode&amp;category=Programming%20Languages&amp;sortBy=Installs">"Programming Languages" category</a> in the Visual Studio Code Marketplace have an <em>onLanguage</em> entry along with other Activation Events, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=octref.vetur">Vetur</a> (5.6M installs - active for <em>Vue</em> only), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml">YAML</a> (4.3M installs - active for <em>YAML</em> only), <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments">Better Comments</a> (1.1M installs - active for supported languages only).</p>
<h3 id="heading-workspacecontains-event">workspaceContains event</h3>
<p>This extension will be activated whenever you open a folder that contains at least one file that matches a glob pattern.</p>
<pre><code class="lang-json"><span class="hljs-string">"activationEvents"</span>: [
    <span class="hljs-string">"workspaceContains:**/package.json"</span>
]
</code></pre>
<h3 id="heading-oncommand-event">onCommand event</h3>
<p>This extension will be activated whenever you invoke a command.</p>
<pre><code class="lang-json"><span class="hljs-string">"activationEvents"</span>: [
        <span class="hljs-string">"onCommand:vscode-docker.compose.down"</span>,
        <span class="hljs-string">"onCommand:vscode-docker.compose.restart"</span>,
        <span class="hljs-string">"onCommand:vscode-docker.compose.up"</span>,
        ...
]
</code></pre>
<h3 id="heading-other-activation-events">Other Activation Events</h3>
<p>You can read the <a target="_blank" href="https://code.visualstudio.com/api/references/activation-events">full list of Activation Events</a> in the reference docs.</p>
<h3 id="heading-do-extensions-set-a-specific-scope-consistently">Do extensions set a specific scope consistently?</h3>
<p>No!</p>
<p>Too many extensions use the <code>*</code> Activation Event.</p>
<p>This is how I would grade the scope definition of some of the extensions I have used:</p>
<ul>
<li><strong>The Good</strong>: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=octref.vetur">Vetur</a>, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml">YAML</a>, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments">Better Comments</a>.</li>
<li><strong>The Bad</strong>: <ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier</a>: It would be better to only target the languages it supports.</li>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one">Markdown All in One</a>: It is active when a markdown file is open, or the workspace contains a README.md. The latter seems unnecessary to me.</li>
</ul>
</li>
<li><strong>The Ugly</strong>: All extensions with the <code>*</code> <em>Activation Event</em> mentioned above.</li>
</ul>
<h2 id="heading-what-impact-can-bundling-have-on-an-extensions-performance">What impact can bundling have on an extension's performance?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/burger-bundle.jpg" alt="bundling a burger" width="600" height="400" loading="lazy">
<small>Edit of untitled photo by <a target="_blank" href="https://unsplash.com/@pablomerchanm?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Pablo Merchán Montes</a> on <a target="_blank" href="https://unsplash.com/s/photos/burger?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></small></p>
<p>It can make a big impact!</p>
<p>John Papa speaks about this in his article "<a target="_blank" href="https://dev.to/azure/is-your-vs-code-extension-slow-heres-how-to-speed-it-up-4d66">Is Your VS Code Extension Slow? Here's How to Speed it Up!</a>". </p>
<p>He reveals the results of an overhaul of 2 of Microsoft's extensions:</p>
<ol>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account&amp;wt.mc_id=devto-blog-jopapa">Azure Account</a>:  Bundling reduced activation time by 50%. The extension size was reduced from 6.2MB to 840KB through bundling and excluding more files (in the <em>.vscodeignore</em> file).</li>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=PeterJausovec.vscode-docker&amp;wt.mc_id=devto-blog-jopapa">Docker</a>: Bundling reduced activation time from 3.5 seconds to under 2 seconds. Also, a consideration is the cold activation time, which tends to be slower than other times (warm activation time). The cold activation time went from a whopping 20 seconds to 2 seconds. </li>
</ol>
<p>You can improve your favourite extension by raising this issue with the author of an extension. The <a target="_blank" href="https://code.visualstudio.com/api/working-with-extensions/bundling-extension">Bundling Extensions User Guide</a> explains how.</p>
<h2 id="heading-how-to-audit-performance">How to audit performance</h2>
<p>You can run the <strong>Developer: Show Running Extensions</strong> command to get the basic stats about the running extensions. It sorts the extensions from longest to shortest activation time. The time is titled "Startup Activation" if the extension is loaded on startup.</p>
<p>As you can see from the screenshot, it also gives warnings about performance issues.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/running-extensions.png" alt="running extensions" width="600" height="400" loading="lazy"></p>
<p>As mentioned previously, it is worth noting that the cold activation time (the first time an extension is run) and warm activation time (second run and later) can vary by a lot. For this reason, you should base typical performance of an extension on a second run.</p>
<p>You can audit the startup performance by running the <strong>Developer: Startup Performance</strong> command. It opens a document with detailed stats about topics such as: system info, performance marks, extension activation stats, loader stats for modules, and more. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/startup-performance1.png" alt="startup performance system info" width="600" height="400" loading="lazy"></p>
<p>The results are specific to the current project and any open files when you execute the command.</p>
<p>The <em>Extension Activation Stats</em> section gives a more detailed overview of extension performance. It is very useful for seeing the <em>Activation Events</em> without needing to check the source code of an extension.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/startup-performance.png" alt="startup performance" width="600" height="400" loading="lazy"></p>
<p>You can see that VS Code loads its own "core" extensions for Git, Emmet, and a few others on startup also. ? You don't want the list of extensions loading on startup to get too long!</p>
<h2 id="heading-scorecard-for-some-of-the-most-popular-extensions">Scorecard for some of the most popular extensions</h2>
<p>I am focusing on extensions that I have used myself here. I don't want to speculate on extensions I haven't really used.</p>
<h3 id="heading-eslint">ESLint</h3>
<p><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint">ESLint</a> is the most popular static analysis tool for JavaScript and TypeScript. It highlights problems in the editor with red squiggly lines. </p>
<ul>
<li><strong>Author</strong>: Microsoft.</li>
<li><strong>Number of installs</strong>: 11 million.</li>
<li><strong>Marketplace Rating:</strong> 4.3/5 (156).</li>
<li><strong>Core features</strong>: Reporting syntax problems. Ability to automatically fix some problems.</li>
<li><strong>Activation Events</strong>:  On startup (<code>*</code>). It may be changed to <code>onStartupFinished</code> in the next release. See <a target="_blank" href="https://github.com/microsoft/vscode-eslint/issues/1068">this open issue</a> for explanation of why this choice was made.</li>
<li><strong>Are resources optimized</strong>: Yes.</li>
<li><strong>File size</strong>: 133KB.</li>
<li><strong>Activation time on my system</strong>: 39ms.</li>
<li><strong>Test suite</strong>: Appears to be very basic. Just a minor test of glob patterns.</li>
<li><strong>Actively maintained</strong>: Yes.</li>
<li><strong>Alternative extensions:</strong> <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.jshint">JS Hint</a>, <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin">TS Lint</a>.</li>
</ul>
<p>ESLint is a solid extension. The performance is excellent. </p>
<p>It is disappointing that it is loaded on startup. If this bothers you, you can try <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.jshint">JS Hint</a> (written by the same developer) for JavaScript, and <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin">TS Lint</a> for TypeScript. Or you can fork the project and change it yourself!</p>
<p>It is actively maintained. It does not have a significant test suite.</p>
<p><strong>Score: 8/10</strong></p>
<h3 id="heading-prettier-code-formatter">Prettier - Code Formatter</h3>
<p><a target="_blank" href="https://prettier.io/">Prettier</a> is an opinionated code formatter. It currently supports the following languages: JavaScript, TypeScript, Flow, JSX, JSON, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown, YAML. </p>
<ul>
<li><strong>Author</strong>: Prettier.</li>
<li><strong>Number of installs</strong>: 8.5 million.</li>
<li><strong>Marketplace Rating:</strong> 3.8/5 (204).</li>
<li><strong>Core features</strong>: Formatting code.</li>
<li><strong>Activation Events</strong>: <code>onStartupFinished</code>.</li>
<li><strong>Are resources optimized</strong>: Yes.</li>
<li><strong>File size</strong>: 2.1MB.</li>
<li><strong>Activation time on my system</strong>: 286ms.</li>
<li><strong>Test suite</strong>: Yes. Coverage looks decent.</li>
<li><strong>Actively maintained</strong>: Yes.</li>
<li><strong>Alternative extensions:</strong> <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify">Beautify</a>.</li>
</ul>
<p>Prettier does a great job at simplifying code formatting.</p>
<p>The performance is fine, but maybe it could be improved. It is on the slower side of the activation spectrum.</p>
<p>The activation scope is very wide. It would be preferable to target the supported languages only. I encountered an issue with Markdown formatting, so I do not use to format Markdown currently. These are things that can be changed easily.</p>
<p><strong>Score: 7.5/10.</strong></p>
<h3 id="heading-live-server">Live Server</h3>
<p><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">Live Server</a> launches a local development server to give a live preview of your HTML and SVG files. </p>
<ul>
<li><strong>Author</strong>: Retwick Dey.</li>
<li><strong>Number of installs</strong>: 7.5 million.</li>
<li><strong>Marketplace Rating:</strong> 4.5/5 (269).</li>
<li><strong>Core features</strong>: HTML and SVG live preview.</li>
<li><strong>Activation Events</strong>: On startup (<code>*</code>).</li>
<li><strong>Are resources optimized</strong>: No.</li>
<li><strong>File size</strong>: 2.5MB.</li>
<li><strong>Activation time on my system</strong>: 2513ms.</li>
<li><strong>Test suite</strong>: Yes. Basic tests.</li>
<li><strong>Actively maintained</strong>: No. Last commit was a year ago. The author of the extension is looking for a new maintainer.</li>
<li><strong>Alternative extensions:</strong> I haven't found one!</li>
</ul>
<p>When it works, it is a convenient extension to use. </p>
<p>The performance is poor and it is no longer maintained. </p>
<p>I would recommend becoming the maintainer and whipping it into shape. Or finding another extension for the job.</p>
<p><strong>Score: 5/10.</strong></p>
<h3 id="heading-gitlens">GitLens</h3>
<p><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> helps visualize code authorship and explore Git repositories.</p>
<ul>
<li><strong>Author</strong>: Eric Amodio.</li>
<li><strong>Number of installs</strong>: 6.5 million.</li>
<li><strong>Marketplace Rating:</strong> 4.86/5 (387)</li>
<li><strong>Core features</strong>: Visualization of code authorship at a glance. Rich sidebar views of git repos.</li>
<li><strong>Activation Events</strong>: On startup (<code>*</code>).</li>
<li><strong>Are resources optimized</strong>: Yes.</li>
<li><strong>File size</strong>: 1.5MB.</li>
<li><strong>Activation time on my system</strong>: 35ms.</li>
<li><strong>Test suite</strong>: No.</li>
<li><strong>Actively maintained</strong>: Yes, but recent activity is low. Last commit was 4 months ago.</li>
<li><strong>Alternative extensions:</strong> None.</li>
</ul>
<p>GitLens is a good idea and can be helpful for gaining insights into a codebase. </p>
<p>It is well-written and the performance is excellent.</p>
<p>I have only used the extension of the blame annotations, but there are a lot of features and configuration options (135 individual settings!).</p>
<p>There are settings to enable each of the features, which is a very good approach. You can toggle the codelens on and off easily.</p>
<p>There has been a lull in activity recently. I don't know if that is a temporary situation or not. So, it's hard to tell how well the extensions will be supported in future. The author has details for supporting him.</p>
<p><strong>Score: 9/10.</strong></p>
<h3 id="heading-vetur">Vetur</h3>
<p>Vue language support.</p>
<ul>
<li><strong>Author</strong>: Pine Wu.</li>
<li><strong>Number of installs</strong>: 5.6 million.</li>
<li><strong>Marketplace Rating:</strong> 4.5/5 (117)</li>
<li><strong>Core features</strong>: Syntax highlighting. Intellisense. Code Formatting.</li>
<li><strong>Activation Events</strong>: <code>onLanguage: vue</code>.</li>
<li><strong>Are resources optimized</strong>: No.</li>
<li><strong>File size</strong>: 70.6 MB.</li>
<li><strong>Activation time on my system</strong>: 252ms. However, the "Finish Activate" stat is 3943ms!</li>
<li><strong>Test suite</strong>: Yes.</li>
<li><strong>Actively maintained</strong>: Yes.</li>
<li><strong>Alternative extensions:</strong> No obvious alternative. Formatting can be done with Prettier.</li>
</ul>
<p>Vetur is the go-to extension for developing Vue apps in VS Code. </p>
<p>The syntax highlighting, intellisense, and hover references are great to have for Vue development. </p>
<p>The size of the extension is HUGE. </p>
<p>The performance is a bit erratic. It takes at least 4 seconds on my machine to finish activation, which is a lot longer than the built-in <em>JavaScript Language Features</em>. There is also a noticeable delay for autocompletion of JavaScript syntax.</p>
<p>The Developers are working on bundling the extension at the moment in <a target="_blank" href="https://github.com/vuejs/vetur/pull/2301">this issue</a>, so hopefully there will be an improvement in the performance soon. ?</p>
<p><strong>Score: 7/10.</strong></p>
<h3 id="heading-settings-sync">Settings Sync</h3>
<p><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync">Settings Sync</a> synchronize settings using GitHub Gist.</p>
<ul>
<li><strong>Author</strong>: Shan Khan.</li>
<li><strong>Number of installs</strong>: 2 million.</li>
<li><strong>Marketplace Rating:</strong> 4.61/5 (638)</li>
<li><strong>Core features</strong>: Sync settings.</li>
<li><strong>Activation Events</strong>: On startup (<code>*</code>).</li>
<li><strong>Are resources optimized</strong>: Yes.</li>
<li><strong>File size</strong>: 1.2 MB.</li>
<li><strong>Activation time on my system</strong>: 2513ms. </li>
<li><strong>Test suite</strong>: Yes.</li>
<li><strong>Actively maintained</strong>: No. Last commit was 1 year ago.</li>
<li><strong>Alternative extensions:</strong> This is a <a target="_blank" href="https://code.visualstudio.com/docs/editor/settings-sync">built-in feature in VS Code</a>.</li>
</ul>
<p>This was a standout extension. Syncing your complete editor setup across machines is super useful.</p>
<p>Since July 2020, the same functionality is a built-in feature in VS Code for this very thing. The main difference is that this extension saves your settings to a gist, which you have the option to share with others too. </p>
<p>The activation time is quite slow. Is it justifiably slow? It's hard to tell. </p>
<p>My guess is that the built-in feature will do a better job eventually as it has the backing of Microsoft. The extension appears to be no longer supported.</p>
<p><strong>Score: 8/10.</strong></p>
<h3 id="heading-markdown-all-in-one">Markdown All in One</h3>
<p><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one">Markdown All in One</a> fulfills a lot of your markdown needs.</p>
<ul>
<li><strong>Author</strong>: Yu Zhang.</li>
<li><strong>Number of installs</strong>: 1.7 million.</li>
<li><strong>Marketplace Rating:</strong> 4.8/5 (90)</li>
<li><strong>Core features</strong>: Toggle-style editing. Table of contents. </li>
<li><strong>Activation Events</strong>:  <code>onLanguage: markdown</code>, <code>onCommand: markdown.extension.printToHtmlBatch</code>, <code>workspaceContains: README.md</code>.</li>
<li><strong>Are resources optimized</strong>: Yes.</li>
<li><strong>File size</strong>: 4.1 MB.</li>
<li><strong>Activation time on my system</strong>: 195ms. </li>
<li><strong>Test suite</strong>: Yes.</li>
<li><strong>Actively maintained</strong>: Yes.</li>
<li><strong>Alternative extensions:</strong> <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=robole.marky-markdown">Marky Markdown</a>.</li>
</ul>
<p>It is a solid extension and the performance is excellent.</p>
<p>It has too many features for my taste. For many people it is appealing to have everything they may want in a single extension.</p>
<p>The Activation Event <code>workspaceContains: README.md</code> seems an unnecessary inclusion to me. Most of my projects have a README, but I seldom edit them. So for me this is like having the extension always active. </p>
<p>The logic for the table of contents is a bit usual. It had some problems with false positives in the past. I don't know if that has been ironed out completely.</p>
<p>The file size of the extension can be reduced by excluding the README screenshots from the extension package.</p>
<p><strong>Score: 8/10.</strong></p>
<h2 id="heading-general-performance-tips">General Performance Tips</h2>
<h3 id="heading-use-a-64-bit-os">Use a 64-bit OS</h3>
<p>If you upgrade to a 64-bit version of an OS, you can expand the amount of virtual memory (VM) available to VS Code from 2 GB to 4 GB. </p>
<p>This enables VS Code to handle significantly larger workloads when VM is required.</p>
<h3 id="heading-disable-restoration-of-project-state-on-startup">Disable restoration of project state on startup</h3>
<p>VS Code automatically restores the project state from the previous session. This can prolong the times it takes to load a project. </p>
<p>You can disable some of the restore settings to speed up the loading time:</p>
<ul>
<li><code>Workbench › Editor: Restore View State</code>: Enabled by default.</li>
<li><code>Files: Restore Undo Stack</code>: Enabled by default.</li>
<li><code>Workbench: Startup Editor</code>:  Controls which editor is shown at startup. The default is <code>welcome page</code>. You can set this to <code>none</code> to prevent any editor appearing on startup.</li>
</ul>
<h3 id="heading-disable-expensive-features-that-impact-editing-performance">Disable expensive features that impact editing performance</h3>
<ul>
<li><strong>Minimap</strong>: <code>Editor › Minimap: Enabled</code>. Enabled by default.</li>
<li><strong>Word wrap</strong>: <code>Editor: Word Wrap</code>. Disabled by default.</li>
<li><strong>CodeLens</strong>: <code>Editor: CodeLens</code>. Enabled by default.</li>
<li><strong>Format on Save</strong>: <code>Editor: Format On Save</code>. Disabled by default.</li>
<li><strong>Format on Paste</strong>: <code>Editor: Format On Paste</code>. Disabled by default.</li>
</ul>
<h3 id="heading-disable-extensions-for-a-workspace">Disable extensions for a workspace</h3>
<p>You can disable an extension for a workspace (project).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/10/disable-extension-workspace.png" alt="disable extension for workspace" width="600" height="400" loading="lazy"></p>
<p>You are most likely going to want to do this for extensions that run always. For a Java project, you are not going to need ESLint! </p>
<p>You can take the opposite approach also. You can disable an extension globally, and only enable it for a select number of projects.</p>
<h3 id="heading-create-extension-sets">Create extension sets</h3>
<p>You can specify an alternate directory for extensions from the command-line as below.</p>
<pre><code class="lang-bash">code --extensions-dir &lt;dir&gt;
</code></pre>
<p>So, if you want to use different sets of extensions, you can. You can add a desktop shortcut for this, or an alias to run this regularly from the command-line.</p>
<p>One thing to keep in mind is syncing. If you sync your extensions between machines, you may want to exclude extensions from the sync. Otherwise, you may mess up your folder by mistake when you switch.</p>
<p>Ideally, you should not need to do this.</p>
<h3 id="heading-disable-all-extensions-for-a-session">Disable all extensions for a session</h3>
<p>You can start VS Code with all user extensions disabled from the command-line. Zen mode plus plus!</p>
<pre><code class="lang-bash">code --disable-extensions
</code></pre>
<h2 id="heading-troubleshooting-performance-issues">Troubleshooting performance issues</h2>
<h3 id="heading-experiencing-slowness-or-a-blank-screen">Experiencing slowness or a blank screen</h3>
<p>VS Code has trouble with GPU (graphics processing unit) hardware acceleration on some systems. You can see if this is the case by disabling GPU acceleration.</p>
<pre><code class="lang-bash">code --disable-gpu
</code></pre>
<p>To set this permanently, do the following: </p>
<ul>
<li>Open the Command Palette (Ctrl+Shift+P).</li>
<li>Run the <strong>Preferences: Configure Runtime Arguments</strong> command.</li>
<li>This command will open a <code>argv.json</code> file to configure runtime arguments. You might see some default arguments there already.</li>
<li>Add <code>"disable-hardware-acceleration": true</code>.</li>
<li>Restart VS Code.</li>
</ul>
<h3 id="heading-installation-appears-to-be-corrupt-with-unsupported-message">Installation appears to be corrupt with [Unsupported] message</h3>
<p>VS Code does a background check when it starts up to check if you've changed any of its source files. If this is the case, you'll see the <strong>[Unsupported]</strong> text in the title bar. </p>
<p>One cause of this issue can be anti-virus software. VS Code could have been mistakenly quarantined, or had files removed by the anti-virus software (see issue <a target="_blank" href="https://github.com/microsoft/vscode/issues/94858">#94858</a>). Check your anti-virus software settings to prevent this. </p>
<p>To solve this situation you can <a target="_blank" href="https://code.visualstudio.com/download">reinstall VS Code</a>. This will replace the modified files and silence the warning.</p>
<h2 id="heading-final-words">Final Words</h2>
<p>You shouldn't need to compromise on performance to get the features you need. </p>
<p>The most pragmatic approach is incrementally add the extensions you need. Do a little bit of research each time and test out the extension. And before you know it, you will have an awesome portfolio of extensions.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Visual Studio Code Snippets – the Definitive VS Code Snippet Guide for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ By Rob O'Leary Snippets can add a touch of magic to your editor. It's like an incantation. Utter a short phrase (type a prefix), wave your wand (press Enter or Tab), and presto! A wonderful event unfolds in front of you. ✨ Most code editors support s... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/definitive-guide-to-snippets-visual-studio-code/</link>
                <guid isPermaLink="false">66d460c5bd438296f45cd3a6</guid>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Snippet ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 24 Sep 2020 18:00:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/09/harry-hd.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Rob O'Leary</p>
<p>Snippets can add a touch of magic to your editor. It's like an incantation. Utter a short phrase (type a prefix), wave your wand (press <code>Enter</code> or <code>Tab</code>), and presto! A wonderful event unfolds in front of you. ✨</p>
<p>Most code editors support snippets out of the box. The code editor I will use to showcase snippets is Visual Studio Code (VS Code), the most popular editor of the day.</p>
<p>Also, there are some "text expander" apps that allow you to use snippets globally (across all apps). I will briefly cover how you can utilise these apps to get even more out of snippets.</p>
<p>Let's dive into all things snippets. ?</p>
<h2 id="heading-definition">Definition</h2>
<blockquote>
<p> A snippet is a template that can be inserted into a document. It is inserted by a command or through some trigger text. </p>
</blockquote>
<p>With snippets, you can create a boilerplate file, and insert commonly used blocks of text. The general idea is to save you typing out the same things completely again and again, and again. ?</p>
<h2 id="heading-why-should-you-use-snippets">Why should you use Snippets?</h2>
<p>I'm not going to shock you with this statement: the internet is home to a lot conflicting opinions! Snippets do not escape this ignominy, but I don't think it is a topic that make people's blood pressure soar! </p>
<p>For the sake of balance, I will present a cross-section of those opinions here. </p>
<p>You don't have to pick a camp and be all-for or all-against snippets. I suggest you adopt them to a degree that serves you best.</p>
<h3 id="heading-yay-camp">Yay Camp ?</h3>
<ul>
<li>Snippets can boost your productivity, saving you keystrokes and reducing input errors.</li>
<li>Snippets leaves me with more mental CPU and enjoyment to spend on writing the code that I care about and want to focus on.</li>
<li>Snippets can help you to remember to include something important!</li>
<li>Integrating snippets into your workflow implicitly encourages you to use the mouse less often. Well-written snippets offer a logical path which you can tab through, stopping to edit along the way to complete the template exactly the way you want, and when you are done, you arrive on the other side ready to write your next line</li>
</ul>
<h3 id="heading-nay-camp">Nay Camp ?</h3>
<ul>
<li>I refrain from using them, mostly because I don't like being reliant on any given tool.</li>
<li>I never use snippets. I prefer to invest time in avoiding repetition rather than making it easier.</li>
<li>I found that at some point I forgot how to write the code without using the snippet. For trivial stuff that I understand, it is OK, but I don't want to forget some other stuff!</li>
<li>Most, if not all, snippets I've seen online, for code I'm looking for, have mistakes in them. I've not once been able to find a numerical algorithm that didn't have floating point errors in it. I can't imagine there being any resource of perfectly clean code snippets.</li>
</ul>
<h2 id="heading-when-should-you-use-snippets">When should you use snippets?</h2>
<p>Donald Knuth, one of the grand-wizards of computer science, said "premature optimization [of code] is the root of all evil". </p>
<p>I think this is relevant to snippets also. Snippets are an optimization of code production. If you don't know a language or framework very well, implementing a slew of snippets for that language or framework is likely to be a premature move.</p>
<p>If you are comfortable, then try some out!</p>
<h2 id="heading-what-i-use-snippets-for">What I use snippets for</h2>
<p>Personally, I use snippets often but judiciously. I use a set of snippets for Markdown and most of the languages I work with.</p>
<p>I haven't used snippets much for frameworks. I started using some snippets for Vue recently, but I only use the boilerplate snippet. I will probably adopt more of them once my Vue IQ has risen. </p>
<p>I haven't used snippets for algorithms.</p>
<h2 id="heading-types-of-snippets">Types of Snippets</h2>
<p>Snippets can be classified according to the scope of interactivity between the snippet and the editor. </p>
<h4 id="heading-static-snippets">Static Snippets</h4>
<p>You can think of it as a copy-and-paste of some source text as a single command. </p>
<h4 id="heading-dynamic-snippets">Dynamic Snippets</h4>
<p>A dynamic snippet can be customised to provide a wizard-like experience for completion of a snippet.  </p>
<p>It can include:</p>
<ul>
<li><em>Tab Stops</em>: You can number stops that can be tabbed through in order,</li>
<li><em>Mirrored Tab Stops</em>: There are times when you need to provide the same value in several places in the inserted text. You can mirror a tab stop to achieve this, and any edit will be reflected in the related tab stops instantly.</li>
<li><em>Placeholders</em> : It is a tab stop with a default value which can be overwritten on focus.</li>
<li><em>Choices</em> : At a tab stop you are presented with a dropdown list of values to choose from.</li>
<li><em>Variables</em>: Input values from the environment such as: the selected text in the editor, system dates, or content from the clipboard.</li>
</ul>
<p>Here is an example of a markdown snippet which adds a task list with 2 tasks. It uses <em>tab stops</em>, <em>placeholders</em>, and <em>choices</em> for checking a task.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/task.gif" alt="task" width="600" height="400" loading="lazy"></p>
<h4 id="heading-macro-snippets">Macro Snippets</h4>
<p>The top level of sorcery is to have the capability to transform input. Transformations allow you to alter the value of a variable before they are inserted, or alter a placeholder after you have made an edit. </p>
<p>For example, you may want to capitalise a class name once it is entered.  </p>
<p>Anything that you can think of doing with a regex is typically possible.  Some editors offer more advanced scripting possibilities. </p>
<h2 id="heading-snippets-in-visual-studio-code">Snippets in Visual Studio Code</h2>
<p>In VS Code, snippets appear in <strong>IntelliSense</strong> (<code>Ctrl+Space</code> gives you a suggestion list), they are mixed in with other suggestions. </p>
<p>You can also access them in a dedicated snippet picker by using the <strong>'Insert Snippet' command</strong>. This combines all user, extension, and built-in snippets for that language into a single list. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/insert-snippet-list.png" alt="insert-snippet-list" width="600" height="400" loading="lazy"></p>
<p><a target="_blank" href="https://www.emmet.io/">Emmet</a> is integrated into VS Code and has it's own CSS-selector inspired syntax for inserting HTML and CSS snippets. </p>
<p>Emmet is it's own thing really, but the mechanics are the same. You can learn about Emmet with the <a target="_blank" href="https://code.visualstudio.com/docs/editor/emmet">Emmet in Visual Studio Code guide</a>.</p>
<h3 id="heading-related-user-settings">Related User Settings</h3>
<p>Snippets will appear as <strong>quick suggestions</strong> if the setting <code>editor.quickSuggestions</code> is set to true for the language you are working in. Quick suggestions are enabled by default for most languages except markdown. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/quick-suggestions-js.png" alt="quick-suggestions-js" width="600" height="400" loading="lazy"></p>
<p>Snippets support <strong>tab-completion</strong>. You can type a snippet prefix (the trigger text), and press <code>Tab</code> to insert a snippet.  You can enable it with the setting <code>editor.tabCompletion</code>.</p>
<p>The values are:</p>
<ul>
<li><code>on</code>: Tab completion is enabled for all sources.</li>
<li><code>off</code>: Disable tab completions. This is the <em>default value</em>.</li>
<li><code>onlySnippets</code>: Tab completion only for snippets. </li>
</ul>
<pre><code class="lang-json"><span class="hljs-string">"editor.tabCompletion"</span>: <span class="hljs-string">"onlySnippets"</span>,
</code></pre>
<p>If you would like to control how <strong>snippets suggestions</strong> are shown, you can edit the setting <code>editor.snippetSuggestions</code>.</p>
<p>The values are:</p>
<ul>
<li><code>top</code>: Show snippet suggestions on top of other suggestions. I use this value.</li>
<li><code>bottom</code>: Show snippet suggestions below other suggestions.</li>
<li><code>inline</code>: Show snippets suggestions with other suggestions. This is the <em>default value</em>.</li>
<li><code>none</code>: Do not show snippet suggestions.</li>
</ul>
<pre><code class="lang-json"><span class="hljs-string">"editor.snippetSuggestions"</span>: <span class="hljs-string">"top"</span>,
</code></pre>
<p>These are the most important settings for snippets, but there are a few more. You can check out this <a target="_blank" href="https://code.visualstudio.com/docs/getstarted/settings#_default-settings">list of the default settings</a> to explore more, or do a search in the Settings UI.</p>
<h3 id="heading-are-there-built-in-snippets">Are there built-in snippets?</h3>
<p>Yes! </p>
<p>They aren't documented in the VS Code docs, though. And inside VS Code, there is no central point to browse them. So, you may not know what they are. </p>
<p>So, how can you find out what languages have built-in snippets?</p>
<p>Long story short, I was frustrated by this scenario, so I wrote an extension called <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=robole.snippets-ranger"><strong>Snippets Ranger</strong></a> to give a nice UI to explore snippets easily. Think of it as a <em>Marauder's Map</em> for snippets!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/snippets-ranger.png" alt="snippets-ranger" width="600" height="400" loading="lazy"></p>
<h4 id="heading-but-i-want-to-find-the-snippets-for-myself">But I want to find the snippets for myself?</h4>
<p>You can, it just requires a bit more effort.</p>
<p>As I mentioned earlier, the <strong>'Insert Snippet' command</strong> will show you all snippets for the language of the active document. </p>
<p>Remember though, this is an <em>aggregate</em> of all of the user, extension, and built-in snippets.  So, if you want to find out if a particular language has built-in snippets, you need to open a file for that language, and run the command to see that list. </p>
<p>If you have an snippets extension installed for that language that makes it too hard to identify which is which, you could disable it to ensure that only the built-in snippets are showing. ?</p>
<p>If you want to track down the source file yourself, the built-in snippets live inside each individual language extension directory. The file is located at <code>«app root»\resources\app\extensions\«language»\snippets\«language».code-snippets</code> on Windows. The location is similar for Mac and Linux.</p>
<h3 id="heading-snippets-extensions">Snippets Extensions</h3>
<p>The Visual Studio Marketplace has a <a target="_blank" href="https://marketplace.visualstudio.com/search?target=VSCode&amp;category=Snippets&amp;sortBy=Installs">snippets category</a> where you can find snippets for almost anything.</p>
<p>A lot of Programming Language Pack extensions include snippets also (Python, C#, Go, Java, and C/C++ amongst others).</p>
<h3 id="heading-how-do-i-write-my-own">How do I write my own?</h3>
<p>Snippets files are written in JSON. You can also add C-style comments if you wish (technically it is Microsoft's "JSONC" format).</p>
<p>You can create snippets for different scopes: global, workspace, and for a particular language. </p>
<p>To create the snippets file, run the <strong>'Preferences: Configure User Snippets' command</strong>, which opens a quickpick dialog as below. Your selection will open a file for editing.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/user-snippets.png" alt="user snippets" width="600" height="400" loading="lazy"></p>
<p>If you would prefer to write a snippet in a GUI, you can use the <a target="_blank" href="https://snippet-generator.app">snippet generator web app</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/snippet-generator.png" alt="snippet generator" width="600" height="400" loading="lazy"></p>
<p>Let's look at an example to get familiar with the syntax.</p>
<h4 id="heading-example">Example</h4>
<p>Here is a markdown snippet that comes with VS Code. </p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"Insert heading level 1"</span>: {
       <span class="hljs-attr">"prefix"</span>: <span class="hljs-string">"heading1"</span>,
       <span class="hljs-attr">"body"</span>: [<span class="hljs-string">"# ${1:${TM_SELECTED_TEXT}}$0"</span>],
       <span class="hljs-attr">"description"</span> : <span class="hljs-string">"Insert heading level 1"</span>
    }
}
</code></pre>
<p>This snippet inserts a level 1 heading which wraps the markdown around the current selection (if there is one).</p>
<p>A snippet has the following properties:</p>
<ol>
<li>"Insert heading level 1"  is the snippet name. This is the value that is displayed in the IntelliSense suggestion list if no <code>description</code> is provided.</li>
<li>The<code>prefix</code> property defines the trigger phrase for the snippet. It can be a string or an array of strings (if you want multiple trigger phrases). Substring matching is performed on prefixes, so in this case, typing "h1" would match our example snippet.</li>
<li>The <code>body</code> property is the content that is inserted into the editor. It is an array of strings, which is one or more lines of content. The content is joined together before insertion. </li>
<li>The <code>description</code> property can provide more information about the snippet. It is optional. </li>
<li>The <code>scope</code> property allows you to target specific languages, and you can supply a comma-separated list in the string. It is optional. Of course, it is redundant for a language-specific snippet file.</li>
</ol>
<p>The body of this snippet has 2 tab stops and uses the variable <code>${TM_SELECTED_TEXT}</code>. </p>
<p>Let's get into the syntax to understand this fully.</p>
<h4 id="heading-snippet-syntax">Snippet syntax</h4>
<p>VS Code's snippet syntax is the same as the <a target="_blank" href="https://manual.macromates.com/en/snippets">TextMate snippet syntax</a>. However, it does not support 'interpolated shell code' and the use of the <code>\u</code> transformation.</p>
<p>The <code>body</code> of a snippet supports the following features:</p>
<h4 id="heading-1-tab-stops">1. Tab Stops</h4>
<p>Tab stops are specified by a dollar sign and an ordinal number e.g. <code>$1</code> . <code>$1</code> will be the first location, <code>$2</code> will the second location, and so on. <code>$0</code> is the final cursor position, which exits the snippet mode. </p>
<p>For example, let's say we want to make an HTML <em>div</em> snippet and we want the first tab stop to be between the opening and closing tags. We also want to allow the user to tab outside of the tags to finish the snippet. </p>
<p>Then we could make a snippet like this:</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"Insert div"</span>: {
        prefix: <span class="hljs-string">"div"</span>,
        body: [<span class="hljs-string">"&lt;div&gt;"</span>,<span class="hljs-string">"$1"</span>,<span class="hljs-string">"&lt;/div&gt;"</span>, <span class="hljs-string">"$0"</span>]
    }
}
</code></pre>
<h4 id="heading-2-mirrored-tab-stops">2. Mirrored Tab Stops</h4>
<p>There are times when you need to provide the same value in several places in the inserted text. In these situations you can re-use the same ordinal number for tab stops to signal that you want them mirrored. Then your edits are synced. </p>
<p>A typical example is a <em>for</em> loop which uses an <em>index</em> variable multiple times. Below is a JavaScript example of a <em>for</em> loop.</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"For Loop"</span>: {
        <span class="hljs-attr">"prefix"</span>: <span class="hljs-string">"for"</span>,
        <span class="hljs-attr">"body"</span>: [
            <span class="hljs-string">"for (let ${1:index} = 0; ${1:index} &lt; ${2:array}.length; ${1:index}++) {"</span>,
            <span class="hljs-string">"\tconst ${3:element} = ${2:array}[${1:index}];"</span>,
            <span class="hljs-string">"\t$0"</span>,
            <span class="hljs-string">"}"</span>
        ]
    }
}
</code></pre>
<h4 id="heading-3-placeholders">3. Placeholders</h4>
<p>Placeholders are tab stops with default values. They are wrapped in curly braces, for example <code>${1:default}</code>. The placeholder text is selected on focus such that it can be easily edited. Placeholders can be nested, like this: <code>${1:first ${2:second}}</code>.</p>
<h4 id="heading-4-choices">4. Choices</h4>
<p>Choices present the user with a list of values at a tab stop. They are written as a comma-separated list of values enclosed in pipe-characters e.g. <code>${1|yes,no|}</code>. </p>
<p>This is the code for the markdown example shown earlier for inserting a task list. The choices are 'x' or a blank space.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"Insert task list"</span>: {
    <span class="hljs-attr">"prefix"</span>: <span class="hljs-string">"task"</span>,
    <span class="hljs-attr">"body"</span>: [<span class="hljs-string">"- [${1| ,x|}] ${2:text}"</span>, <span class="hljs-string">"${0}"</span>]
}
</code></pre>
<h4 id="heading-5-variables">5. Variables</h4>
<p>There is a good selection of variables you can use. You simply prefix the name with a dollar sign to use them, for example <code>$TM_SELECTED_TEXT</code>. </p>
<p>For example, this snippet will create a block comment for any language with today's date:</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"Insert block comment with date"</span>: {
        prefix: <span class="hljs-string">"date comment"</span>,
        body: [<span class="hljs-string">"${BLOCK_COMMENT_START}"</span>,
               <span class="hljs-string">"${CURRENT_YEAR}/${CURRENT_MONTH}/${CURRENT_DATE} ${1}"</span>,
               <span class="hljs-string">"${BLOCK_COMMENT_END}"</span>]
    }
}
</code></pre>
<p>You can specify a default for a variable if you wish, like <code>${TM_SELECTED_TEXT:default}</code>. If a variable does not have a value assigned, the default or an empty string is inserted. </p>
<p>If you make a mistake and include a variable name that is not defined, the name of the variable is transformed into a placeholder.</p>
<p>The following workspace variables can be used:</p>
<ul>
<li><code>TM_SELECTED_TEXT</code>: The currently selected text or the empty string,</li>
<li><code>TM_CURRENT_LINE</code>: The contents of the current line,</li>
<li><code>TM_CURRENT_WORD</code>: The contents of the word under cursor or the empty string,</li>
<li><code>TM_LINE_INDEX</code>: The zero-index based line number,</li>
<li><code>TM_LINE_NUMBER</code>: The one-index based line number,</li>
<li><code>TM_FILENAME</code>: The filename of the current document,</li>
<li><code>TM_FILENAME_BASE</code>: The filename of the current document without its extensions,</li>
<li><code>TM_DIRECTORY</code>: The directory of the current document,</li>
<li><code>TM_FILEPATH</code>: The full file path of the current document,</li>
<li><code>CLIPBOARD</code>: The contents of your clipboard,</li>
<li><code>WORKSPACE_NAME</code>: The name of the opened workspace or folder.</li>
</ul>
<p>The following time-related variables can be used:</p>
<ul>
<li><code>CURRENT_YEAR</code>: The current year,</li>
<li><code>CURRENT_YEAR_SHORT</code>: The current year's last two digits,</li>
<li><code>CURRENT_MONTH</code>: The month as two digits (example '07'),</li>
<li><code>CURRENT_MONTH_NAME</code>: The full name of the month (example 'July'),</li>
<li><code>CURRENT_MONTH_NAME_SHORT</code>: The short name of the month (example 'Jul'),</li>
<li><code>CURRENT_DATE</code>: The day of the month,</li>
<li><code>CURRENT_DAY_NAME</code>: The name of day (example 'Monday'),</li>
<li><code>CURRENT_DAY_NAME_SHORT</code>: The short name of the day (example 'Mon'),</li>
<li><code>CURRENT_HOUR</code>: The current hour in 24-hour clock format,</li>
<li><code>CURRENT_MINUTE</code>: The current minute,</li>
<li><code>CURRENT_SECOND</code>: The current second,</li>
<li><code>CURRENT_SECONDS_UNIX</code>: The number of seconds since the Unix epoch.</li>
</ul>
<p>The following comment variables can be used. They honour the syntax of the document's language:</p>
<ul>
<li><code>BLOCK_COMMENT_START</code>: For example, <code>&lt;!--</code> in HTML,</li>
<li><code>BLOCK_COMMENT_END</code>: For example ,  <code>--&gt;</code> in HTML,</li>
<li><code>LINE_COMMENT</code>: For example,  <code>//</code> in JavaScript.</li>
</ul>
<h4 id="heading-6-transformations">6. Transformations</h4>
<p>Transformations can be applied to a variable or a placeholder. If you are familiar with regular expressions (regex), most of this should be familiar.</p>
<p>The format of a transformation is: <code>${«variable or placeholder»/«regex»/«replacement string»/«flags»}</code>. It is similar to <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace">String.protoype.replace()</a> in JavaScript. The "parameters" do the following:</p>
<ul>
<li><code>«regex»</code>: This is a regular expression that is matched against the value of the variable or placeholder. The JavaScript regex syntax is supported.</li>
<li><code>«replacement string»</code>: This is the string you want to replace the original text with. It can reference capture groups from the <code>«regex»</code>, perform case formatting (using the special functions: <code>/upcase</code>, <code>/downcase</code>, and <code>/capitalize</code>), and perform conditional insertions. See <a target="_blank" href="https://macromates.com/manual/en/regular_expressions#replacement_string_syntax_format_strings">TextMate Replacement String Syntax</a> for more in-depth information.</li>
<li><code>«flags»</code>: Flags that are passed to the regular expression. The <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags_2">JavaScript regex flags</a> can be used: <ul>
<li><code>g</code> : Global search, </li>
<li><code>i</code> : Case-insensitive search, </li>
<li><code>m</code> : Multi-line search,  </li>
<li><code>s</code> : Allows <code>.</code> to match newline characters,</li>
<li><code>u</code> : Unicode. Treat the pattern as a sequence of Unicode code points, </li>
<li><code>y</code> : Perform a "sticky" search that matches starting at the current position in the target string.</li>
</ul>
</li>
</ul>
<p>To reference a capture group, use <code>$n</code> where <code>n</code> is the capture group number. Using <code>$0</code> means the entire match. </p>
<p>This can be a bit confusing since tab stops have the same syntax. Just remember that if it is contained within forward slashes, then it is referencing a capture group.</p>
<p>The easiest way to understand the syntax fully is to check out a few examples.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Snippet <em>body</em></td><td>Input</td><td>Output</td><td>Explanation</td></tr>
</thead>
<tbody>
<tr>
<td><code>["${TM_SELECTED_TEXT/^.+$/• $0/gm}"]</code></td><td>line1<br>line2</td><td>• line1<br>• line2</td><td>Put a bullet point before each non-empty line of the selected text.</td></tr>
<tr>
<td><code>["${TM_SELECTED_TEXT/^(\\w+)/${1:/capitalize}/}"]</code></td><td>the cat is on the mat.</td><td>The cat is on the mat.</td><td>Capitalize the first word of selected text.</td></tr>
<tr>
<td><code>["${TM_FILENAME/.*/${0:/upcase}/}"]</code></td><td>example.js</td><td>EXAMPLE.JS</td><td>Insert the filename of the current file uppercased.</td></tr>
<tr>
<td><code>[</code><br><code>"[",</code><br><code>"${CLIPBOARD/^(.+)$/'$1',/gm}",</code><br><code>"]"</code><br><code>]</code></td><td>line1<br>line2</td><td>['line1', 'line2',]</td><td>Turn the contents of the clipboard into a string array. Each non-empty line is an element.</td></tr>
</tbody>
</table>
</div><p>As you can see from the second example above, metacharacter sequences must be escaped, for example insert <code>\\w</code> for a word character.</p>
<h4 id="heading-placeholder-transformations">Placeholder Transformations</h4>
<p><strong>Placeholder transforms do <u>not</u> allow a default value or choices</strong>! Maybe it is more suitable to call them tab stop transformations.</p>
<p>The example below will uppercase the text of the first tab stop.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/placeholder-transform.gif" alt="placeholder transform" width="600" height="400" loading="lazy"></p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"Uppercase first tab stop"</span>: {
    <span class="hljs-attr">"prefix"</span>: <span class="hljs-string">"up"</span>,
    <span class="hljs-attr">"body"</span>: [<span class="hljs-string">"${1/.*/${0:/upcase}/}"</span>, <span class="hljs-string">"$0"</span>]
  }
}
</code></pre>
<p>You can have a placeholder and perform a transformation on a mirrored instance. The transformation will not be performed on the initial placeholder. ? </p>
<p>Would you use this behaviour somewhere? I find it confusing initially, so it may have the same affect on others.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"Uppercase second tab stop instance only"</span>: {
    <span class="hljs-attr">"prefix"</span>: <span class="hljs-string">"up"</span>,
    <span class="hljs-attr">"body"</span>: [<span class="hljs-string">"${1:title}"</span>, <span class="hljs-string">"${1/(.*)/${1:/upcase}/}"</span>, <span class="hljs-string">"$0"</span>]
  }
}
</code></pre>
<h3 id="heading-how-do-i-assign-keyboard-shortcuts-for-snippets">How do I assign Keyboard Shortcuts for snippets?</h3>
<p>By adding your shortcuts to <code>keybindings.json</code> . You can open the file by running the <strong>'Preferences: Open Keyboard Shortcuts File (JSON)'</strong> command.</p>
<p>For example, to add a shortcut for the built-in markdown snippet "Insert heading level 1":</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"key"</span>: <span class="hljs-string">"ctrl+m ctrl+1"</span>,
    <span class="hljs-attr">"command"</span>: <span class="hljs-string">"editor.action.insertSnippet"</span>,
    <span class="hljs-attr">"when"</span>: <span class="hljs-string">"editorTextFocus &amp;&amp; editorLangId == markdown"</span>,
    <span class="hljs-attr">"args"</span>: {
        <span class="hljs-attr">"langId"</span>: <span class="hljs-string">"markdown"</span>,
        <span class="hljs-attr">"name"</span>: <span class="hljs-string">"Insert heading level 1"</span>
    }
}
</code></pre>
<p>You define a shortcut by specifying the key combination you want to use, the command ID, and an optional <a target="_blank" href="https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts">when clause context</a> for the context when the keyboard shortcut is enabled. </p>
<p>Through the <code>args</code> object, you can target an existing snippet by using the <code>langId</code> and <code>name</code> properties. The <code>langId</code> argument is the <a target="_blank" href="https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers">language ID</a> of the language that the snippets were written for. The <code>name</code> is the snippet's name as it is defined in the snippet file. </p>
<p>You can define an inline snippet if you wish using the <code>snippet</code> property.</p>
<pre><code class="lang-json">[
  {
    <span class="hljs-attr">"key"</span>: <span class="hljs-string">"ctrl+k 1"</span>,
    <span class="hljs-attr">"command"</span>: <span class="hljs-string">"editor.action.insertSnippet"</span>,
    <span class="hljs-attr">"when"</span>: <span class="hljs-string">"editorTextFocus"</span>,
    <span class="hljs-attr">"args"</span>: {
      <span class="hljs-attr">"snippet"</span>: <span class="hljs-string">"${BLOCK_COMMENT_START}${CURRENT_YEAR}/${CURRENT_MONTH}/${CURRENT_DATE} ${1} ${BLOCK_COMMENT_END}"</span>
    }
  }
]
</code></pre>
<p>You can use the <em>Keyboard Shortcuts UI</em> also, but it does not have the ability to add a new shortcut. </p>
<p>Another downside of the UI is that it does not show the <code>args</code> object, which makes it more difficult to find and edit your custom shortcuts. ?</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/shortcuts-ui.png" alt="shortcuts-ui" width="600" height="400" loading="lazy"></p>
<h2 id="heading-a-question-of-style">A question of style</h2>
<p>Something that I found offputting initially with snippets was the propensity for people to create snippets with abbreviated prefixes. Do I have to learn a big list of gibberish acronyms to use someone else's snippets? </p>
<p>What do I mean by abbreviated prefixes?  The table below list a few of the snippets from the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets">JavaScript (ES6) code snippets</a> VS Code extension. You can see in the <em>Trigger</em> column, the prefixes listed are abbreviations, for example <em>fre</em> to represent a "for each" loop.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/es6-snippets-excerpt.png" alt="es6 snippets excerpt" width="600" height="400" loading="lazy"></p>
<p>This is unnecessary in two ways.</p>
<p>Firstly, the quick suggestions offered by VS Code are produced from a <strong>fuzzy substring search</strong>. If I type "fe" and the prefix of a snippet is "foreach", this will match and be offered as a quick suggestion.  </p>
<p>As you can see below, this is the second match.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/fe-quick-suggestion.png" alt="fe quick suggestion" width="600" height="400" loading="lazy"></p>
<p>The first match is <em>fre</em>, which is a snippet from the extension. Which suggestion is more descriptive? ?</p>
<p>If you use the "Insert Snippet" command for snippets, it does not make much of a difference. The description field makes amends for this shortcoming. I don't use snippets in this way, so I would prefer a more descriptive prefix.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/insertsnippet-foreach.png" alt="insert snippet foreach" width="600" height="400" loading="lazy"></p>
<p>Secondly, <em>fre</em> is a <strong>duplicate</strong> of the built-in snippet <em>foreach</em>.</p>
<p>Some people turn off quick suggestions for snippets and use tab completion only. In this case, you need to type a prefix out without getting visual feedback. Some people may prefer to use an abbreviated prefix to save keystrokes here. </p>
<p>The same fuzzy substring search is being performed in the background, so the first snippet match is inserted when you hit tab. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/snippet-tab-completion.gif" alt="snippet-tab-completion" width="600" height="400" loading="lazy"></p>
<p>Looking at the example above, you can see that typing "fr" and hitting <em>tab</em> inserts the <em>fre</em> snippet. Typing "fore" and hitting tab inserts the <em>foreach</em> snippet. </p>
<p>So, you do not need to type out the entire prefix, if you really don't want to! ? If you have many similarly named snippet prefixes for a language, it would be impractical I imagine. </p>
<p>It is more practical to learn the prefixes properly, and type them out entirely before hitting tab.</p>
<p>There are some trade-offs depending on your preferences for using snippets. </p>
<p>Personally, I like to use quick suggestions as I like the visual feedback. I have snippets set to be the top suggestions, that way I can type abbreviated versions of the prefixes without needing to memorise them. </p>
<p>Some snippet authors have rigid patterns to overcome this, but that's just something I can't get into easily.</p>
<p>If you use a lot of snippets for a language, you may want to choose snippets that are written in a similar style. </p>
<p>If you use snippets for different frameworks and libraries in a language, they can add up and overlap. I haven't needed to do this, but you may need to do it eventually.</p>
<h2 id="heading-global-snippets">Global Snippets</h2>
<p>Outside of your code editor, you can benefit from snippets also. Having snippets available in every app offers more possibilities.</p>
<p>Common use cases are:</p>
<ul>
<li>canned responses for messages, </li>
<li>autocorrecting common typos,</li>
<li>adding contact information or signatures to documents,</li>
<li>inserting dates,</li>
<li>formatting of selected text and pasted text,</li>
<li>inserting search phrases for your search engine or app,</li>
<li>HTML snippets available inside your email client,</li>
<li>adding different templates to documents.</li>
</ul>
<p>Most of the apps for snippets are touted as "text expanders", but quite a few task and productivity apps also include snippet-esque features. </p>
<p>Global snippets are <strong>bit more limited that code editor snippets</strong>, as you cannot use tab stops and placeholders. In most apps you can use some dynamic variables such as dates. </p>
<h3 id="heading-app-review">App Review</h3>
<h4 id="heading-autohotkey-windows">Autohotkey (Windows)</h4>
<p><a target="_blank" href="https://www.autohotkey.com/">AutoHotkey</a> is a <strong>free, open-source scripting language for Windows</strong> to do all kinds of tasks. </p>
<p>It has it's own unique syntax. You can install the <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-autohotkey">AutoHotKey extension</a> to add language support to VS Code for a better editing experience.</p>
<p>For defining prefixes to trigger a snippet insertion, you use the following format: <code>::&lt;&lt;prefix&gt;&gt;::&lt;&lt;text to insert&gt;&gt;</code>. The following script will insert Rob's email address when you type "robmail" and hit <em>space</em> or <em>tab</em> or <em>enter</em>.</p>
<pre><code>::robmail::rob@someservername.com
</code></pre><p>The following script will insert the text "This is the snippet text" when you press <code>Ctrl+D</code>.</p>
<pre><code>^d::  Send This is the snippet text
</code></pre><p>You can read the <a target="_blank" href="https://www.autohotkey.com/docs/AutoHotkey.htm">docs</a> to learn more.</p>
<h4 id="heading-phraseexpress-windows-mac-ios">PhraseExpress (Windows, Mac, iOS)</h4>
<p><a target="_blank" href="https://www.phraseexpress.com/">PhraseExpress</a> is "a text expander software, that manages frequently used text templates for insertion into any program". </p>
<p>It is a <strong>freemium, GUI-based app</strong>. It is aimed at a wider audience than <em>AutoHotKey</em>.</p>
<p>It is quite polished and easy to use. You set it to run on start-up and it will be active in the background. </p>
<p>Your snippets can be organized into custom folders and synced using cloud services.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/phrase-express.png" alt="phrase-express" width="600" height="400" loading="lazy"></p>
<h4 id="heading-espanso-windows-mac-linux">Espanso (Windows, Mac, Linux)</h4>
<p>This is a <strong>open-source, cross-platform text expander written in Rust</strong>. </p>
<p>It uses a <strong>file-based configuration approach</strong>. The config files are written in <a target="_blank" href="https://en.wikipedia.org/wiki/YAML">YAML</a>.</p>
<p>The <code>default.yml</code> file contains the main configuration. The config below will insert Rob's email address when you type "robmail" .</p>
<pre><code class="lang-yaml"><span class="hljs-attr">matches:</span>
 <span class="hljs-bullet">-</span> <span class="hljs-attr">trigger:</span> <span class="hljs-string">":robmail"</span>
   <span class="hljs-attr">replace:</span> <span class="hljs-string">"rob@someservername.com"</span>
</code></pre>
<p>You can <strong>specify the initial cursor position</strong>, however you cannot define tab stops.</p>
<p>You can <strong>add extensions</strong> to increase the capability of Espanso. There are extensions for running external scripts, including dates, generating random text, and including clipboard data.</p>
<p>And that's about it! I hope you learned something about snippets today, and you can use them to make yourself more productive. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Visual Studio Code Live Server Not Working ]]>
                </title>
                <description>
                    <![CDATA[ VSCode has a lot of great extensions, and Live Server is one of the best.  With just a couple of clicks, Live Server lets you see your page live in an actual browser. Better yet, it features live reloading, so if you update your code, the changes are... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/visual-studio-code-live-server-not-working/</link>
                <guid isPermaLink="false">66c3648f0002df282f2225af</guid>
                
                    <category>
                        <![CDATA[ Browsers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Google Chrome ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 14 Aug 2020 09:28:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9941740569d1a4ca1eab.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>VSCode has a lot of great extensions, and <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">Live Server</a> is one of the best. </p>
<p>With just a couple of clicks, Live Server lets you see your page live in an actual browser. Better yet, it features live reloading, so if you update your code, the changes are also reflected in the browser.</p>
<p>All you have to do is right click in the HTML file you want to view, right click, then select "Open with Live Server":</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/live-server-ex.gif" alt="Image" width="600" height="400" loading="lazy">
<em>Live Server in action</em></p>
<p>But what if Live Server doesn't open your browser and show your page like you expect? If this is happening to you, here are a few things you can try.</p>
<h2 id="heading-restart-vscode">Restart VSCode</h2>
<p>Sometimes the best you can do is start VSCode from scratch.</p>
<p>First, save all of your work. Then close VSCode, which will also stop all of the extensions you've installed.</p>
<p>Then, reopen VSCode and try again – go to the HTML file you want to view, right click, and select "Open with Live Server".</p>
<h2 id="heading-set-the-browser-for-live-server">Set the browser for Live Server</h2>
<p>It's possible that the extension is working, but your system doesn't have a default browser.</p>
<p>Even if you did set the default browser for your system, it wouldn't hurt to let Live Server know which browser you'd like to use explicitly.</p>
<p>First, open the Command Pallete with F1, then type in <code>Preferences: Open Settings (JSON)</code> and select that option.</p>
<p>This will open your VSCode <code>settings.json</code> file.</p>
<p>Scroll all the way to the bottom of the file, add a comma after the last setting, then paste in <code>"liveServer.settings.CustomBrowser": "chrome"</code>:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/settings-json.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Note that you can also use <code>"firefox"</code>, <code>"safari"</code>, or any other browser as the value for the <code>"liveServer.settings.CustomBrowser"</code> setting.</p>
<p>Finally, save the <code>settings.json</code> file and try to run Live Server again.</p>
<h2 id="heading-set-the-default-browser-for-your-operating-system">Set the default browser for your operating system</h2>
<p>Even after telling Live Server which browser you want to use, it's possible that it's still not opening your page in that browser correctly.</p>
<p>The next thing to try is to set the default browser for your operating system itself.</p>
<p>The exact method for doing this can vary based on your operating system, so it's best to search for how to do this if you aren't sure.</p>
<p>Here's what the settings page looks like in Windows:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image-56.png" alt="Image" width="600" height="400" loading="lazy">
<em>Credit: <a target="_blank" href="https://forum.freecodecamp.org/u/Advitya-sharma">Advitya-sharma</a></em></p>
<h2 id="heading-go-to-the-live-page-yourself">Go to the live page yourself</h2>
<p>If for some reason Live Server still isn't opening the page in your browser automatically, no worries. You can always open the browser of your choice and view the page directly.</p>
<p>Just open your preferred browser and go to <code>http://127.0.0.1:5500/&lt;your_file_name&gt;</code>.</p>
<p>For example, if your file is called <code>index.html</code>, just go to <code>http://127.0.0.1:5500/index.html</code>.</p>
<p>As long as Live Server is running, you should see your page.</p>
<h2 id="heading-in-closing">In closing</h2>
<p>Those are a few common fixes you can try if Live Server isn't working the way you expect.</p>
<p>Stay safe, and happy (live) coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Make Your Own VS Code Extension ]]>
                </title>
                <description>
                    <![CDATA[ By Pramono Winata I just made my first VS Code extension. And it felt good! This article will cover basic steps to help you create your own VS Code extension. Along the way I'll share what I learned from making one for the first time.  I am not an ]]>
                </description>
                <link>https://www.freecodecamp.org/news/making-vscode-extension/</link>
                <guid isPermaLink="false">66d460973a8352b6c5a2aad9</guid>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Software Engineering ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 04 Jun 2020 04:05:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/06/0-lDZSUwewtGWo6M4J.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Pramono Winata</p>
<p>I just made my first VS Code extension. And it felt good! This article will cover basic steps to help you create your own VS Code extension. Along the way I'll share what I learned from making one for the first time. </p>
<p>I am not an expert at this yet, but I can truly say that <strong>nothing is as hard as it seems.</strong> ?</p>
<h2 id="heading-lets-talk-about-vs-code-and-its-extension-marketplace">Let's talk about VS Code and its Extension Marketplace</h2>
<p>If you opened this article, you have probably at least heard about VS Code (or Visual Studio Code). If not, it's basically a light-weight code editor developed by Microsoft.</p>
<p>Since VS Code is a code editor, it can perform much faster and lighter than a typical IDE such as Eclipse. But with that performance comes one disadvantage: IDEs often provide better tools such as built-in linters, better code templates, code versioning tools, and some features such as auto complete.</p>
<p>But where VS Code actually shines is the power of the community. It allows you to install extensions that come directly from the VS Code marketplace itself. These extensions allow you to customize it however you wish. You can, for example, add a linter or any other features like colorful brackets. You can even put a nyan cat in your VS Code!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/Screenshot-from-2020-05-31-23-42-52.png" alt="Image" width="600" height="400" loading="lazy">
<em>Who doesn't like a nyan cat?</em></p>
<h2 id="heading-why-should-you-create-a-vs-code-extension">Why should you create a VS Code extension?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/0-EErfJXzBUg_qzUsI.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Yes, ‘why’ is the keyword here. It's the first and most important thing to talk about when you want to start doing something. </p>
<p>Ask yourself why do you want to make it? Most people usually answer because they want to <strong>learn something</strong> or <strong>gain fame,</strong> or maybe even both. But the more reasons there are, the more motivation you will have.</p>
<p>One thing I can say is that you don’t need to think big yet. Just make a tool that is very specific, that maybe only you will use. The first step is always the hardest. And at the end of day at least you've helped yourself with your extension.</p>
<p>As for myself, I built an extension because of one particular reason: I wanted to make a tool that I could use to increase my productivity. And that would maybe even help a small part of the community near me. (Spoiler: it's golang unit test generator)</p>
<p>That’s why the extensions that I've made are very precise and have a very specific use case. I'm not going for a big mark, I am aiming to increase my productivity and learn something new. I think that is enough reason for me.</p>
<p>And of course everything seemed impossible at the start. Making VS Code extensions looks like some genius level piece art of work (but of course it's not). Since I have a lot of free time on my hands at the moment, I figured I might as well try it out.</p>
<h2 id="heading-the-very-first-step-of-building-a-vs-code-extension">The Very first step of Building a VS Code Extension</h2>
<p>To get started, you have to have VS Code installed. In case you don’t have it yet, I will just put the download link <a target="_blank" href="https://code.visualstudio.com/download">here</a>.</p>
<p>VS Code extensions support two main languages: JavaScript and TypeScript. So having some knowledge of either of these is pretty mandatory.</p>
<p>Also, make sure you have Node.js installed, since we are going to use a lot of npm packages here.</p>
<h2 id="heading-how-to-generate-a-vs-code-extension-template">How to Generate a VS Code Extension Template</h2>
<p>Ah, templates. How very convenient. VS Code already has its own template generator, so let’s jump straight into it.</p>
<p>First, install your template generator with <code>npm install -g yo generator-code</code></p>
<p>Afterwards, let's run it with <code>yo code</code>. And it will prompt out this weird head thing (?) and language selection. Just pick your preferred language and proceed. (I picked JavaScript here).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/yo-code.png" alt="Image" width="600" height="400" loading="lazy">
<em>yo code</em></p>
<p>Afterwards, you will need to edit your extension name and description. You can just proceed with anything you prefer.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/Screenshot-from-2020-05-26-23-07-28.png" alt="Image" width="600" height="400" loading="lazy">
<em>or maybe just enter all the way</em></p>
<p>Now, a folder called hellovscode will be created in your home directory. Open it with VS Code by simply typing <code>code hellovscode</code> in the folder directory.</p>
<p>Use the <code>F5</code> key to run your extension and another window will popup. Now press <code>ctrl+shift+p</code> and find the <code>Hello World</code> command, run it, and a popup should come out in the bottom right corner. Like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/sample-hello.gif" alt="Image" width="600" height="400" loading="lazy">
<em>Magic? Nope. Just collection of code.</em></p>
<p>Voilà! You've just run your first extension. But what is actually happening with all that? Don’t worry, I will explain some bits below, mainly regarding two files: <code>extension.js</code> and <code>package.json</code>.</p>
<h2 id="heading-what-is-the-extensionjs-file-in-vs-code">What is the Extension.js File in VS Code?</h2>
<p>This is where you will spend most of your time coding. This file will contain all your code blocks and logic flow.</p>
<p>There isn’t much difference between this and normal Node code. But one of the main differences is registering your commands. You will come upon this block <code>vscode.commands.registerCommand('hellovscode.helloWorld'</code>.</p>
<p>In a nutshell, it will register your function call to be used.</p>
<p>Another difference is the frequent usage of the VS Code API – but we will come back to that later on.</p>
<p>If you looked through the code, you will see this too: <code>vscode.window.showInformationMessage('Hello World from hellovscode!');</code> </p>
<p>As an experiment, try changing the value of the message and try running it again.</p>
<h3 id="heading-packagejson">Package.json</h3>
<p>This file is the one that basically will link the commands you created from <code>extension.js</code> with the commands that you defined.</p>
<p>You will see the command that you have registered above <code>hellovscode.helloWorld</code> being put as a part of the command titled <code>Hello World</code>. And that’s how the command actually links to your code.</p>
<p>Apart from this, this file will also enable the command to be put on the right click bar. It will also filter where the command should appear (file type).</p>
<h2 id="heading-how-to-publish-your-vs-code-plugin">How to Publish Your VS Code Plugin</h2>
<p>Just in case you might want to publish your extension, I will show you how to do that here:</p>
<p>Step 1: First and foremost, install vsce with <code>npm install -g vsce</code>. We will use this most of the time to publish.</p>
<p>Step 2: If you don’t have a Microsoft account yet, you should <a target="_blank" href="https://signup.live.com/">register here</a> since we will be needing the access token you'll get.</p>
<p>Step 3: Once you have the account sign in to the <a target="_blank" href="https://marketplace.visualstudio.com/VSCode">marketplace</a>. Create your <a target="_blank" href="https://aex.dev.azure.com/me?mkt=en-US">organization</a> and click on it (you should see something like the below).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/ss.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 4: Now click on the upper right corner where the red circle is and select Personal Access Token. Create your personal access token and choose all accessible organizations with full access.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/Screenshot-from-2020-05-29-23-56-42.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 5: Remember your token since you'll use it when uploading your extension.</p>
<p>Step 6: You will need to create your publisher identity now. So go to your command prompt and type <code>run vsce create-publisher YOUR_PUBLISHER_NAME</code> .<br>Insert your own name, email, and personal access token when prompted. Your publisher account should successfully be created.</p>
<p>Step 7: It’s publishing time! Prepare your extension environment in the command prompt and type <code>vsce package</code>. This will package your extension to marketplace format. Then type <code>vsce publish</code>.</p>
<p>And that’s it, your extension will be published.</p>
<p>On a side note, when publishing you should modify your readme (at least the first part where it says <code>This is Readme for..</code> ) since vsce will detect it and ask you to modify it.</p>
<h2 id="heading-some-additional-tips-for-building-vs-code-extensions">Some Additional Tips for Building VS Code Extensions</h2>
<p>Now you should have some basic understanding of how VS Code extensions work. Here, I will share some things that I have learned.</p>
<h3 id="heading-utilizing-vs-codes-api">Utilizing VS Code's API</h3>
<p>VS Code itself has provided a lot of APIs for you to use to make your extension. You might encounter several common obstacles when building your extension, like getting your cursor position, getting the line position, or maybe getting the highlighted word. Those all can be tackled with using the VS Code API.</p>
<p>You should read through their <a target="_blank" href="https://code.visualstudio.com/api/references/vscode-api">documentation</a> and experiment with their API. You can even try reading through their API code! With the amount of documentation inside the code itself, you should be able to somewhat figure out which API will be most helpful.</p>
<h3 id="heading-googling-things-read-the-docs-or-code">Googling things (read the docs or code)</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/04/image-169.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Most of the time in our programming life, when we are stuck there is always Google or <a target="_blank" href="https://stackoverflow.com/">Stack Overflow</a> that can provide quick help.</p>
<p>But this time it will not always save you.</p>
<p>First of all, googling for help in this case is quite tricky. For example, say you want to highlight a word on cursor – you might search for <code>vs code extension how to get total line...</code> or something similar.</p>
<p>But let me tell you, most of the time it will direct you to the real extension itself or give you manual on how to use VS Code.</p>
<p>One way you can make it easier for yourself is by adding the "API" keyword in your search, like <code>vs code extension api how to ...</code>.</p>
<p>Also, it is pretty hard to find the relevant answers in Google, because the developer community is not that huge, and VS Code extensions may look intimidating for many newcomers. But truthfully, <strong>it is not exactly that hard</strong>.</p>
<p>That’s why sometimes the best way to learn how to develop a VS Code extension is by reading the documentation or the code.</p>
<h2 id="heading-a-vs-code-extension-github-example-repository">A VS Code Extension GitHub Example Repository</h2>
<p>I have provided a text manipulation example in my <a target="_blank" href="https://github.com/pramonow/vscode-extension-ut">GitHub repository</a> which might help for code references (watch out for some messy code though!). The code will generate some template unit tests in the Go language.</p>
<h2 id="heading-wrapping-up">Wrapping up</h2>
<p>What I have covered here are just the basics of creating a VS Code extension. One message I want you to take to heart is that <strong>it is not as hard as it looks.</strong> Sometimes you just need to push yourself a bit and try it out.</p>
<p>You might come across some challenges along the way, but if you never even start you are missing out completely.</p>
<p>In the end, thanks for taking the time to read this. I hope you enjoyed it and started to understand all the things I just explained.</p>
<p>And hopefully you will also start making an extension too!</p>
<p><em>Happy coding to you all in this social distancing time.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to get started with Angular 6.0 ]]>
                </title>
                <description>
                    <![CDATA[ By Ankit Sharma Learn what’s new and build an app Angular has released its latest version, Angular 6.0. In this article, we will understand the new features of Angular 6.0 and also set up a new project with the help of Angular CLI 6.0 and Visual Stud... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-get-started-with-angular-6-0-a196cbfb9bbb/</link>
                <guid isPermaLink="false">66d45db3246e57ac83a2c715</guid>
                
                    <category>
                        <![CDATA[ Angular ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Visual Studio Code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 06 May 2018 16:16:54 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*mmxWHaqZZtNMs_ggYnx8hg.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Ankit Sharma</p>
<h4 id="heading-learn-whats-new-and-build-an-app">Learn what’s new and build an app</h4>
<p>Angular has released its latest version, Angular 6.0. In this article, we will understand the new features of Angular 6.0 and also set up a new project with the help of Angular CLI 6.0 and Visual Studio Code.</p>
<h3 id="heading-whats-new-in-angular-60">What’s new in Angular 6.0?</h3>
<h4 id="heading-ng-update">ng update</h4>
<p>A new CLI command that will update your project dependencies to their latest versions.</p>
<h4 id="heading-ng-add">ng add</h4>
<p>Another new CLI command that makes adding new capabilities to your project easier.</p>
<h4 id="heading-angular-elements">Angular Elements</h4>
<p>This is a new feature that allows us to compile Angular components to native web components which we can use in our Angular app.</p>
<h4 id="heading-element-is-deprecated"> element is deprecated</h4>
<p>You can’t use  anymore inside of your component templates. You need to use  instead.</p>
<h4 id="heading-library-support">Library support</h4>
<p>Angular CLI now has the support for creating and building libraries. To create a library project within your CLI workspace, run the following command: ng generate library  (for example: ng generate library my-demo-lib)</p>
<h4 id="heading-angular-material-starter-components">Angular Material Starter Components</h4>
<p>If you run “ng add @angular/material” to add material to an existing application, you will also be able to generate 3 new starter components:</p>
<ul>
<li><strong>Material Sidenav</strong><br>A starter component including a toolbar with the app name and the side navigation</li>
<li><strong>Material Dashboard</strong><br>A starter dashboard component containing a dynamic grid list of cards</li>
<li><strong>Material Data Table</strong><br>A starter data table component that is pre-configured with a datasource for sorting and pagination</li>
</ul>
<h4 id="heading-workspace-support">Workspace support</h4>
<p>Angular CLI now has support for workspaces containing multiple projects, such as multiple applications and/or libraries.</p>
<h4 id="heading-the-angular-clijson-file-has-been-deprecated">The “.angular-cli.json” file has been deprecated</h4>
<p>Angular projects will now use “angular.json” instead of “.angular-cli.json” for build and project configuration.</p>
<h4 id="heading-use-rxjs-v6">Use RxJS V6</h4>
<p>Angular 6 will also allow us to use RxJS V6 with our application.</p>
<h4 id="heading-tree-shakable-providers">Tree Shakable Providers</h4>
<p>Angular 6.0 allows us to bundle services into the code base in modules where they are injected. This will help us to make our application smaller.</p>
<p>For example: Earlier, we used to reference our services as below.</p>
<pre><code><span class="hljs-comment">// In app.module.ts    @NgModule({    ...    providers: [MyService]  })  export class AppModule {}    // In myservice.ts     import { Injectable } from '@angular/core';    @Injectable()  export class MyService {    constructor() { }  }</span>
</code></pre><p>This approach will still work, but Angular 6.0 provides a new and easier alternative to this. We no longer need to add references in our NgModule. We can inject the reference directly into the service. Therefore, we can use the service as below:</p>
<pre><code><span class="hljs-comment">// In myservice.ts    import { Injectable } from '@angular/core';    @Injectable({    providedIn: 'root',  })  export class MyService {    constructor() { }  }</span>
</code></pre><p>Those are the new features/improvements in the latest release of Angular. Let’s move on and create our first application using Angular 6.0.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li>Install the latest version of Node.js from <a target="_blank" href="https://nodejs.org/en/download/">here</a></li>
<li>Install Visual Studio Code from <a target="_blank" href="https://code.visualstudio.com/">here</a></li>
</ul>
<p>Installing Node.js will also install npm on your machine. After installing Node.js, open the command prompt and run the following set of commands to check the version of Node and npm installed on your machine.</p>
<p>Refer to the below image:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/PpLMXyOskr9A5wpHDndRTG8IkvpRvJ6H9DVb" alt="Image" width="613" height="282" loading="lazy"></p>
<p>Now that we’ve installed Node and npm, the next step is to install Angular CLI. Run the following command in a command window. This will install Angular 6.0 CLI globally on your machine.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/rskMSFRtqxuqxXA80OYMwHVhnR-3AGrxDsS5" alt="Image" width="650" height="305" loading="lazy"></p>
<p>Open VS Code and navigate to View &gt;&gt; Integrated Terminal.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-bJC4pD8YZXAZdB2h6ez7WjmdZWcS0D5IpMo" alt="Image" width="524" height="732" loading="lazy"></p>
<p>This will open a terminal window in VS Code.</p>
<p>Type the following sequence of commands in the terminal window. These commands will create a directory with the name “<em>ng6Demo</em>” and then create an Angular application with the name “<em>ng6App</em>” inside that directory.</p>
<ul>
<li>mkdir ng6Demo</li>
<li>cd ng6Demo</li>
<li>ng new ng6App</li>
</ul>
<p><img src="https://cdn-media-1.freecodecamp.org/images/n7ub05-40gA8P9HxCosSWJDoy5PyYSA0kHoA" alt="Image" width="479" height="389" loading="lazy"></p>
<p>There we go — we have created our first Angular 6 application using VS Code and Angular CLI. Now run the following command to open the project.</p>
<p>Refer to the image below:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/hcwLxqSELFiSmKaGJ9Wbjmlmtm4ThL1ZpNVU" alt="Image" width="409" height="107" loading="lazy"></p>
<p>This will open the code file of our application in a new VS Code window. You can see the following file structure in Solution Explorer.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/m8PPvMTg1DzehHavw-zrEx16BuG-RIQ5jMSy" alt="Image" width="256" height="412" loading="lazy"></p>
<p>Notice that the folder structure is a little bit different from the older version of Angular. We have a new “angular.json” file instead of the old “.angular-cli.json” file. This config file will still serve the same task as before, but the schema has changed a bit.</p>
<p>Open the package.json file and you can observe that we have the latest Angular 6.0.0 packages installed in our project.</p>
<pre><code>{    <span class="hljs-string">"name"</span>: <span class="hljs-string">"ng6-app"</span>,    <span class="hljs-string">"version"</span>: <span class="hljs-string">"0.0.0"</span>,    <span class="hljs-string">"scripts"</span>: {      <span class="hljs-string">"ng"</span>: <span class="hljs-string">"ng"</span>,      <span class="hljs-string">"start"</span>: <span class="hljs-string">"ng serve"</span>,      <span class="hljs-string">"build"</span>: <span class="hljs-string">"ng build"</span>,      <span class="hljs-string">"test"</span>: <span class="hljs-string">"ng test"</span>,      <span class="hljs-string">"lint"</span>: <span class="hljs-string">"ng lint"</span>,      <span class="hljs-string">"e2e"</span>: <span class="hljs-string">"ng e2e"</span>    },    <span class="hljs-string">"private"</span>: <span class="hljs-literal">true</span>,    <span class="hljs-string">"dependencies"</span>: {      <span class="hljs-string">"@angular/animations"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/common"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/compiler"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/core"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/forms"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/http"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/platform-browser"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/platform-browser-dynamic"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular/router"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"core-js"</span>: <span class="hljs-string">"^2.5.4"</span>,      <span class="hljs-string">"rxjs"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"zone.js"</span>: <span class="hljs-string">"^0.8.26"</span>    },    <span class="hljs-string">"devDependencies"</span>: {      <span class="hljs-string">"@angular/compiler-cli"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@angular-devkit/build-angular"</span>: <span class="hljs-string">"~0.6.0"</span>,      <span class="hljs-string">"typescript"</span>: <span class="hljs-string">"~2.7.2"</span>,      <span class="hljs-string">"@angular/cli"</span>: <span class="hljs-string">"~6.0.0"</span>,      <span class="hljs-string">"@angular/language-service"</span>: <span class="hljs-string">"^6.0.0"</span>,      <span class="hljs-string">"@types/jasmine"</span>: <span class="hljs-string">"~2.8.6"</span>,      <span class="hljs-string">"@types/jasminewd2"</span>: <span class="hljs-string">"~2.0.3"</span>,      <span class="hljs-string">"@types/node"</span>: <span class="hljs-string">"~8.9.4"</span>,      <span class="hljs-string">"codelyzer"</span>: <span class="hljs-string">"~4.2.1"</span>,      <span class="hljs-string">"jasmine-core"</span>: <span class="hljs-string">"~2.99.1"</span>,      <span class="hljs-string">"jasmine-spec-reporter"</span>: <span class="hljs-string">"~4.2.1"</span>,      <span class="hljs-string">"karma"</span>: <span class="hljs-string">"~1.7.1"</span>,      <span class="hljs-string">"karma-chrome-launcher"</span>: <span class="hljs-string">"~2.2.0"</span>,      <span class="hljs-string">"karma-coverage-istanbul-reporter"</span>: <span class="hljs-string">"~1.4.2"</span>,      <span class="hljs-string">"karma-jasmine"</span>: <span class="hljs-string">"~1.1.1"</span>,      <span class="hljs-string">"karma-jasmine-html-reporter"</span>: <span class="hljs-string">"^0.2.2"</span>,      <span class="hljs-string">"protractor"</span>: <span class="hljs-string">"~5.3.0"</span>,      <span class="hljs-string">"ts-node"</span>: <span class="hljs-string">"~5.0.1"</span>,      <span class="hljs-string">"tslint"</span>: <span class="hljs-string">"~5.9.1"</span>    }  }
</code></pre><p>The name of our Angular application is <em>ng6app</em> which is inside <em>ng6demo</em> directory.</p>
<p>So, we will first navigate to our application using the below commands.</p>
<p>And then we use the following command to start the web server.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/aERCZwSg9S74d2ZxBtQxwx50kL2IRfmJjSYy" alt="Image" width="650" height="265" loading="lazy"></p>
<p>After running this command, you can see that it is asking to open <a target="_blank" href="http://localhost:4200"><em>http://localhost:4200</em></a> in your browser. So, open any browser on your machine and navigate to this URL. Now, you can see the following page.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/IjRPyX7l6pOcgmXtT3ml1WSYRFU09uhDrGAD" alt="Image" width="650" height="322" loading="lazy"></p>
<p>Now we will try to change the welcome text on the screen. Navigate to <em>/src/app/app.component.ts</em> file and replace the code with the below code.</p>
<pre><code><span class="hljs-keyword">import</span> { Component } <span class="hljs-keyword">from</span> <span class="hljs-string">'@angular/core'</span>;    @Component({    <span class="hljs-attr">selector</span>: <span class="hljs-string">'app-root'</span>,    <span class="hljs-attr">templateUrl</span>: <span class="hljs-string">'./app.component.html'</span>,    <span class="hljs-attr">styleUrls</span>: [<span class="hljs-string">'./app.component.css'</span>]  })  <span class="hljs-keyword">export</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AppComponent</span> </span>{    title = <span class="hljs-string">'Csharp Corner'</span>;  }
</code></pre><p>Now open the browser, you can see that the web page has been updated with new welcome message “Welcome to Csharp Corner!”</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/c5mAy0iqq0fAlCVSgceh51pMHuH7OEoreQXN" alt="Image" width="650" height="321" loading="lazy"></p>
<p>In this article we learned about the new features of Angular 6.0. We have installed the Angular 6.0 CLI and created our first Angular 6.0 application with the help of Visual Studio Code. We have also customized the welcome message on the webpage.</p>
<p>You can also find this article at <a target="_blank" href="https://www.c-sharpcorner.com/article/getting-started-with-angular-6/">C# Corner</a>.</p>
<p>You can check my other articles on Angular <a target="_blank" href="http://ankitsharmablogs.com/category/angular/">here</a></p>
<p>Originally published at <a target="_blank" href="https://ankitsharmablogs.com/">https://ankitsharmablogs.com/</a></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
