Skip to content

Commit cce6db2

Browse files
committed
updated doc
1 parent 64288a3 commit cce6db2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Documentation/Getting started.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ You can create or open this file by either using the `"C/Cpp: Edit Configuration
2020

2121
You can specify the remaining paths using one of the techniques described below.
2222

23-
#### 1. Use the lightbulb suggestions to auto-resolve includePath
23+
#### 1. Use compile_commands.json file to supply includePaths and defines information
2424

25-
The first thing to try is to leverage the lightbulb path suggestions to auto-resolve the include paths. When you open a folder, the extension will **recursively** search for potential include paths that match the header files your code is using based on the paths set by the `"browse.path"` setting in **c_cpp_properties.json**. Click on the green squiggles under #include statements and you'll see a lightbulb offering suggestions of paths that will allow IntelliSense to resolve the included file.
25+
The extension can get the information for `"includePath"` and `"defines"` from a compile_commands.json file, which can be auto-generated by many build systems such as CMake and Ninja. Set the `"compileCommands"` property in **c_cpp_properties.json** 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.
2626

27-
![lightbulb suggestions](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/lightbulb%20suggestion.png)
27+
![use compileCommands setting](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/compile_commands.png)
2828

29-
If you don't see path suggestions in the lightbulb, try adding the root folder where the headers are likely located in to the `"browse.path"` setting in **c_cpp_properties.json**. This allows the extension to **recursively** search in these folders and offer more suggestions in the lightbulb as the search process goes on.
29+
#### 2. Use the lightbulb suggestions to auto-resolve includePath
3030

31-
#### 2. Use compile_commands.json file to supply includePaths and defines information
31+
The first thing to try is to leverage the lightbulb path suggestions to auto-resolve the include paths. When you open a folder, the extension will **recursively** search for potential include paths that match the header files your code is using based on the paths set by the `"browse.path"` setting in **c_cpp_properties.json**. Click on the green squiggles under #include statements and you'll see a lightbulb offering suggestions of paths that will allow IntelliSense to resolve the included file.
3232

33-
The extension can get the information for `"includePath"` and `"defines"` from a compile_commands.json file, which can be auto-generated by many build systems such as CMake and Ninja. Set the `"compileCommands"` property in **c_cpp_properties.json** 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+
![lightbulb suggestions](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/lightbulb%20suggestion.png)
3434

35-
![use compileCommands setting](https://github.com/Microsoft/vscode-cpptools/raw/ronglu-edit/Images/compile_commands.png)
35+
If you don't see path suggestions in the lightbulb, try adding the root folder where the headers are likely located in to the `"browse.path"` setting in **c_cpp_properties.json**. This allows the extension to **recursively** search in these folders and offer more suggestions in the lightbulb as the search process goes on.
3636

3737
#### 3. Manually add include paths
3838
If none of the above fully resolves the paths, you could manually specify the paths to the headers that your project depends on in the **c_cpp_properties.json** file. 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.

0 commit comments

Comments
 (0)