Skip to content

Commit 20e51db

Browse files
committed
updates
1 parent 03c6c4d commit 20e51db

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Documentation/Getting started.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
This page describes how to configure include paths for folders containing C or C++ files to get the full IntelliSense experience. If you're seeing the following message when opening a folder in VS Code, it means the C++ IntelliSense engine needs additional information about the paths in which your symbols are located.
44

5-
![Configure includePath for better IntelliSense](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/configure%20includepath.jpg)
5+
![Configure includePath for better IntelliSense](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/configure%20includepath.jpg)
66

7-
## Where to configure the include paths
7+
## How to configure the include paths
88

99
When you open a folder, the extension will attempt to locate your system headers based on your operating system, but it does not know about any auxiliary libraries that your project depends on. You can specify the remaining paths by either using the `"C/Cpp: Edit Configurations"` command in the command palette, or by selecting `"Edit "includePath" setting"` in the lightbulb menu (see the screenshot below). The quickiest way to locate the lightbulb is to scroll to the top of the source file and click on any green squiggle, which usually shows up at the first line in the file.
1010

1111
![lightbulb menu "Edit "includePath" setting"](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/Lightbulb.png)
1212

13-
This creates or opens a file called **c_cpp_properties.json** in the .vscode directory in the opened folder in your workspace. In this file, you can specify the paths to the headers that your project depends on. Look for the section where your current configuration is defined (by default there's one configuration per OS, such as "Win32 or "Mac"), and add your paths in the `"includePath"` setting and defines in the `"defines"` setting. For example, the following screenshot shows a snippet of the file specifying path for the Mac configuration.
13+
This creates or opens a file called **c_cpp_properties.json** in the .vscode directory in the opened folder. In this file, you can specify the paths to the headers that your project depends on. Look for the section where your current configuration is defined (by default there's one configuration per OS, such as "Win32 or "Mac"), and add your paths in the `"includePath"` setting and defines in the `"defines"` setting. For example, the following screenshot shows a snippet of the file specifying path for the Mac configuration.
1414

1515
![c_cpp_properties file snippet](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/c_cpp_properties%20file.PNG)
1616

1717
You can either hover over the green squiggles to see the message in the tooltip, or open the Problems window to understand which headers the IntelliSense engine is unable to open.
1818

19-
![include error message](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/Include%20errors.png)
19+
![include error message](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/Include%20errors.png)
2020

2121
## Tips for setting up include paths quickly
2222

@@ -30,7 +30,8 @@ You can also leverage the lightbulb path suggestions lightbulb to auto-resolve t
3030

3131
#### 2. Use compile_commands.json file to supply includePaths and defines information
3232

33-
If your build system is able to produce a compile_commands.json file, which can be auto-generated by build systems such as CMake and Ninja, the extension can get the information for the `"includePath"` and `"defines"` from that. Set the `"compileCommands"` property to the full path to your compile_commands.json file and the extension will use that instead of the `"includes"` and `"defines"` properties for IntelliSense.
33+
If your build system is able to produce a compile_commands.json file, which can be auto-generated by build systems such as CMake and Ninja, the extension can get the information for the `"includePath"` and `"defines"` from that. Set the `"compileCommands"` property to the full path to your compile_commands.json file and the extension will use that instead of the `"includes"` and `"defines"` properties for IntelliSense.
34+
3435
![use compileCommands setting](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/compile_commands.png)
3536

3637
## Verify the include paths are correctly resolved

Images/c_cpp_properties file.PNG

3.41 KB
Loading

0 commit comments

Comments
 (0)