VSCode configuration in C ++ environment

Disclaimer: This article is a blogger original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement.
This link: HTTPS: //blog.csdn.net/desert187/article/details/51025786
VSCode with like Sublime, Sublime inherited many advantages, including multi-select editing interface mouse operation. But Sublime in C / C ++ lacks respect (Clang plug-ins no longer maintained after 2.0), while VSCode is strong in this regard.
The same, VSCode default code is limited to index and fill all open documents, fortunately began to support plug-in function after VSCode 0.10 version. Which is a good plug-in C ++ Intellisense.
You can click VSCode editing interface shortcut Ctrl + P exhaled command bar, then enter
"ext install c ++" + space
to locate the C ++ Intellisense plug-in, click on the download button on the right side, plug-in is automatically installed and are prompted to restart VScode.
GNU C ++ Intellisense plug-in needed to support Global, which is a similar CTag can be used to create a program to achieve the desired index Tag and auto-complete function. Can go to
http://adoxa.altervista.org/global/
download the Windows version of GNU Global, download, unzip, configure the system PATH to Win / bin directory GNU Global directory, this directory contains the binary files such as gtag.exe .
Note, C ++ Intellisense only supports 6.5 or later of GNU Global.
If you save the source code under Win a non windows format, such as utf8, then you need to set the user setting. Set in the way between VSCode press "F1", enter "setting" words, or File-Preference - User Settings. Settings.json user then enter the right side of
{
"codegnuglobal.encoding": "UTF8"
}
Note that, "utf8" you need to change the encoding format.
Next, you may need to restart your computer in order to make the GNU Global PATH takes effect.
Reopen a C / C ++ source code directory, press the Ctrl key and mouse to point to a function, you will see the message of this function, you can also jump to the definition, find references (shift + F12), auto-completion, List symbols (ctrl + P, enter @).

Go to definition

Auto completion

Find references



List symbols


Remember, you need to retype "gtags" command in the source directory project after modifying the code to re-establish Tags. If you think a cmd window to open a lot of trouble, you can install VSCode of Shll plug.

These plug-ins have a very detailed help, see if you need help explain, after clicking Ctrl + P shortcut keys to enter the "ext" + Space, then the top command bar will display the installed plug-ins, click on the right side of the "README" button It can connect to the official website of the plug-in help documentation page.
----------------
Disclaimer: This article is CSDN blogger "lionchan187 'original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/desert187/article/details/51025786

Guess you like

Origin www.cnblogs.com/xiangleili/p/11410689.html