Configure C++ IntelliSense in Visual Studio Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] the c plus plus extension of visual studio code uses the compiler you have on your computer to configure intellisense intellisense includes features like auto completion quick info and parameter help in this case the compiler is clang but it could be any gcc or msvc compatible compiler you chose to install whether you're working across linux windows or mac the first intellisense feature we'll show you is quick info which is helpful info that pops up when you hover over a function call or variable hovering over a function call for example displays its signature and documentation if you hover over a variable you'll learn its type this function contains a vector called message abbreviated as msg if you hover over message intellisense tells you it's a vector of strings the c plus extension will also show you all the vector member functions you can use on the message variable if you start typing msg dot as you would when calling a member function a completion list of all member functions will pop up press the tab key to insert the selected member then when you add the opening parenthesis you'll see information about the arguments that the function requires for this project intellisense works out of the box because the c plus extension found the compiler on my computer after checking a few default locations if intellisense is not working out of the box maybe you're seeing error squiggles underneath your include paths you can edit your intellisense configuration to tell the c plus extension where your compiler and include header files are intellisense configurations live in a properties file inside your project's vs code folder you can edit them through the ui or from the dot json file directly the default configuration name is based on your host os you can toggle between configurations to edit the intellisense settings for a specific configuration the compilerpath property tells the extension which compiler to use when setting up intellisense for your project this involves locating the standard libraries and setting the default pre-processor defines vs code found c plus compilers on my computer after checking a few default locations if your compiler does not appear in the drop down because it is not in a default location you can specify the path to your compiler you can configure the c plus extension to provide proper intellisense when developing for a different architecture than your development host machine for example you may be developing on a 64-bit pc but compiling your program to run on an arm-based device by changing the compiler path and intellisense mode you have provided enough information for the extension to provide the correct intellisense information and reflect the right sizes of architecture specific data types for your project's target architecture you only need to modify the include path setting if your program includes header files that are not in your workspace or the standard library path paths to the standard libraries are added automatically when compiler path is correctly set if you'll be compiling the same project for different platforms it's helpful to add intellisense configurations for each of those platforms [Music] after adding the configuration we can go back to our project source files the intellisense configuration is shown in the status bar you can easily toggle between configurations in the status bar ensuring you have correct intellisense behavior for your target architecture that's how you define c plus plus intellisense configurations and visual studio code for your host and target architecture to learn more head here
Info
Channel: Visual Studio Code
Views: 105,410
Rating: undefined out of 5
Keywords:
Id: w6PnOlmop9Y
Channel Id: undefined
Length: 3min 59sec (239 seconds)
Published: Fri Sep 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.