Computer

Program in C or C ++ from Visual Studio Code with these extensions

C Visual Studio Code extensions

Here we will be able to search for any extension published within the Microsoft Marketplace, download it and install it within the program with just one click. We can also see the extensions that we already have installed in the program and disable the one we don’t want to use, and even uninstall them so they don’t take up space.

Next, we are going to see which are the essential extensions to be able to program in the best possible way in C or C ++ using this program.

Extensions for C or C ++

If we are going to program in one of these two popular programming languages, we must know that we can find extensions of all kinds. Some of them serve to improve the syntax highlighting of the functions, others allow us enable features like IntelliSense or a better debugger, and others, for example, allow us to integrate other services.

Visual Studio Code comes standard with several extensions for C and C ++ installed by default thanks to the C / C ++ Extension Pack. These are:

  • Better C ++ Syntax– Improves syntax highlighting for these languages.
  • C / C ++: IntelliSense and debugger.
  • C / C ++ Themes: themes to improve the view of the code in these languages.
  • CMake– Enable the use of CMake in VSC.
  • CMake Tools– Enables the use of tools and functions to better work with CMake.
  • Remote – WSL: allows us to open any directory with the Windows Subsystem for Linux.
  • Doxygen Documentation Generator– Lets you easily generate Doxygen documentation.
  • Remote – Containers– Open folders or repositories directly within Docker.
  • Remote – SSH– Open any folder on a remote machine with SSH.

And, in addition to this, we can also install many other extensions to improve the operation of the IDE and make our programming much better.

One of the first extensions that we are going to see is Code Runner. Thanks to it, we will be able to execute snippets or code files directly from the editor window itself, without having to compile or configure anything else. The best thing about this extension is that it is compatible with an infinity of programming languages, highlighting, among many others, C, C ++, Java, JavaScript, PHP, Python, Perl, Perl 6, Ruby, Go, Lua, Groovy, PowerShell, BAT / CMD, BASH / SH, F # Script, F # (NET Core), C # Script, C # (NET Core), VBScript, TypeScript, Visual Basic NET, and Swift.

Second, we are going to talk about another addition that seeks to improve one of the functions that come by default included in this program: C ++ Intellisense. What this extension does is add a new Intellisense system for C and C ++ with the help of the GNU Global tags. Ideal for those looking to create free software.

Having trouble or builds to compile and run your code? C / C ++ Compile Run is the extension you are looking for. This plugin allows us to compile and execute any code easily, just by pressing a key on our keyboard, F6 (or F7, if we want to execute specific parameters). Of course, if we are on Linux we will have to install gcc, and if we are on Windows mingw.

There is nothing more tedious than including the libraries of the functions that we are going to use during our programming. And, to help us with this task, there is an extension called Include Autocomplete. Just by typing the command “#include”, the extension will search the specified directories for all the existing libraries, and we will be able to see a series of recommendations to add them automatically.

And, continuing with the auto-complete, we can find another much more complete extension to install: Kite Autocomplete. This extension brings us a complete auto-complete system for a multitude of programming languages ​​(Python, Java, Go, PHP, C / C # / C ++, Javascript, HTML / CSS, Typescript, React, Ruby, Scala, Kotlin, Bash, Vue and React) based on AI. That is, thanks to it we can save a great deal of time when writing commands and functions.

How are VSC extensions used?

Depending on the extension that we are going to use, we can use them in one way or another. The most normal thing, and what the majority do, is that once the extension is installed it is already open and loaded into the program, ready to use it. Some can be used automatically, for example, auto-completion, and others have to be invoked using a keyboard shortcut or performing a specific task.

To find out how an extension works and how we can take advantage of it, what we must do is read the store’s file. We can find this where we have downloaded the extension, and in it we will see an explanation of how it works.

Finally, we remember that if one extension interferes with the operation of another (for example, having two auto-complete), we must disable one. We can do this from the extensions section of Visual Studio Code, using the “Disable” or “Uninstall” buttons. Once done, everything will work normally again.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *