编辑includepath 设置
时间: 2023-09-21 14:09:08 浏览: 206
JSP编译指令page、include详解
编辑includePath的设置可以通过两种方式进行,一种是在c_cpp_properties.json文件中设置,另一种是通过全局设置进行设置。
在c_cpp_properties.json文件中设置includePath可以针对当前工作区进行设置。默认情况下,includePath的设置在c_cpp_properties.json文件中进行。你可以在该文件中添加如下内容来设置includePath:
```
"configurations": \[
{
"name": "Win32",
"includePath": \[
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/app/driver",
"${workspaceFolder}/app/include",
"${workspaceFolder}/app/Gizwits",
"${workspaceFolder}/app/include/driver",
"${workspaceFolder}/include",
"${workspaceFolder}/app/Utils"
\],
"browse": {
"path": \[
"${workspaceFolder}/**"
\],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "${workspaceFolder}/.vscode/.browse.c_cpp.db"
}
}
\]
```
另外,从Visual Studio Code 2017年12月29日开始,官方引入了全局设置的参数Customizing Default Settings。当和c_cpp_properties.json冲突时,以全局的设置为准。你可以通过以下步骤进行全局设置:
1. 打开首选项-设置(Preferences-Settings)。
2. 在设置页面中,找到链接打开setting.json文件。
3. 在setting.json文件中,添加如下内容:
```
"\[cpp\]": {
"editor.quickSuggestions": true
},
"\[c\]": {
"editor.quickSuggestions": true
},
"C_Cpp.default.includePath": \[
"${workspaceFolder}",
"${workspaceFolder}/src",
"${workspaceFolder}/app/driver",
"${workspaceFolder}/app/include",
"${workspaceFolder}/app/Gizwits",
"${workspaceFolder}/app/include/driver",
"${workspaceFolder}/include",
"${workspaceFolder}/app/Utils"
\],
"C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/.browse.c_cpp.db"
```
以上是编辑includePath设置的两种方式,你可以根据需要选择其中一种进行设置。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* *2* *3* [Visual Studio Code 的 includePath 全局设置](https://blog.csdn.net/toopoo/article/details/85295404)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文