1. VSC 常用配置
1.1 settings.json
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components":true,
"**/*.code-search":true,
},
"files.exclude": {
"**/.git":true,
"**/.svn":true,
"**/.hg":true,
"**/CVS":true,
"**/.DS_Store":true
}
}
1. "search.exclude" 里面是需要在搜索结果中需要排除的文件或者文件夹,true: 不搜索;false: 搜索
2. "files.exclude" 是在左侧工程目录中需要排除的文件或文件夹,即不显示在框图中,true: 不显示;false: 显示
Note: 上面使用了通配符 "*",比如 "**/.git" 表示所有.git 结尾的文件或文件夹。".root/[a-l]*" 表示在 root 目录下所有以 "a" ~ "l" 开头的文件或文件夹。
1.2 c_cpp_properties.json
{
"env": {
"myDefaultIncludePath": ["${workspaceFolder}", "${workspaceFolder}/include"],
"myCompilerPath": "/usr/local/bin/gcc-7"
},
"configurations": [
{
"name": "Win32",
"intelliSenseMode": "clang-x64",
"includePath": ["${myDefaultIncludePath}", "/another/path"],
"macFrameworkPath": ["/System/Library/Frameworks"],
"defines": ["FOO", "BAR=100"],
"forcedInclude": ["${workspaceFolder}/include/config.h"],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"compileCommands": "/path/to/compile_commands.json",
"browse": {
"path": ["${workspaceFolder}"],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
1. "includePath" 表示要包含的头文件路径。