You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add possibility to exclude files from parser but not from file list in Workspace. #11609
I'm working in c code-generation for that reason I have files in format *.c with invalid proprietary language to enable/disable specific section of code from another configuration file. Also I have the testing environment in the same workspace.
I would like to know if there is any way to exclude specific files/folders using glob patterns but not hiding them from workspace (only to the parse ignore or hide problems in file). I tried with:
Last one could work but it will hide my files from workspace and I want to keep them.
⚙ Use case
To consult files and not having errors in problems section when the file is expected to have a wrong format (in this case a code-generated c source). For example:
🛠 Possible solution
A setting similar to C_Cpp.files.exclude or to files.exclude which won't report any kind of "problem" related to parser or wrong syntax.
Arath Burgos (@arathburgos05) Okay, looks like that only works for tag parsing if the file isn't open, but it's still parsed by IntelliSense if the file is open, i.e. we'd have to start to check that exclusion for IntelliSense or add a C_Cpp.intelliSense.exclude setting.
You could potentially exclude those particular folders with files.exclude and then re-add them back as a workspace folder with C_Cpp.intelliSenseEngine set to "Tag Parser" for those folders (you'll still get missing include blue/info warnings though).
Reacted by Arath Burgos, Tim Hutt and existedinnettw
I tried not using ** but the errors shown in the first picture are still appearing. As you said, I think C_Cpp.intelliSense.exclude option would be great!
A question... IntelliSense is the tool which reports issues in problems sections? I would like to "skip" some specific paths from scan just keeping in the workspace for reference purposes (but not checking syntax -or reporting them- or adding macros/information to IntelliSense database).
For the moment a workaround will be move that folder to another workspace to prevent affecting me on the indexer (because due I have several copies of a file with wrong syntax then the IntelliSense is showing inexistent errors in some files due to re-definitions) like this one:
Because DUMMY_MACRO was taken by IntelliSense in files/paths that I don't want to be scanned.
A last question... Is there any way to point to workspace folders in the root for "C_Cpp.codeAnalysis.exclude" or similar tags?
for example, something like:
"search.exclude": {
"${workspaceFolder:tests}": true // Excluding all folders from tests folder added to multi-workspace.
}
I can use it in vars like "C_Cpp.default.includePath" but no in "search.exclude" and idk why or if there is any other workaround.
Regards.
My configurations
my_configurations.code-workspace
{
"folders": [
{
"path": "./repoWithSyntaxNotValid" // A Git repo to be ignored by IntelliSense
},
{
"path": "./libraries" // All in this folder can be scanned by IntelliSense without any problem
},
{
"path": "./tests" // Folder with some sub-folders to be ignored by IntelliSense
}
],
"settings": {
// Graphical editor - Settings
"debug.toolBarLocation": "commandCenter",
"editor.stickyScroll.defaultModel": "outlineModel",
"editor.stickyScroll.maxLineCount": 10,
"diffEditor.ignoreTrimWhitespace": true,
"editor.stickyScroll.enabled": true,
"editor.tabCompletion": "on",
"powershell.integratedConsole.forceClearScrollbackBuffer": true,
"workbench.editor.labelFormat": "short",
"window.zoomLevel": -0.2,
"editor.fontSize": 13,
"editor.minimap.maxColumn": 100,
"editor.minimap.autohide": true,
"editor.minimap.renderCharacters": true,
"editor.minimap.showSlider": "always",
"editor.minimap.size": "fill",
"editor.scrollbar.vertical": "visible",
"window.titleSeparator": " 🔷 ",
"window.title": "${activeEditorShort}${separator}${dirty}${folderName}${separator}${rootName}",
"terminal.integrated.tabs.description": "${task}${separator}${local}${separator}${cwdFolder}",
"terminal.integrated.tabs.title": "${process}${separator}${activeEditorShort}",
"editor.gotoLocation.multipleDefinitions": "peek",
"workbench.editor.wrapTabs": true,
"workbench.editor.tabSizing": "fit",
"workbench.editor.tabCloseButton": "off",
"workbench.editor.pinnedTabSizing": "compact",
// Optimizations - Settings
"debug.allowBreakpointsEverywhere": true,
"terminal.integrated.enableImages": false,
"terminal.integrated.gpuAcceleration": "auto",
"terminal.integrated.enablePersistentSessions": false,
"terminal.integrated.persistentSessionReviveProcess": "never",
"editor.indentSize": "tabSize",
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.scrollback": 1000000,
"task.quickOpen.skip": false,
"task.quickOpen.history": 1,
"task.autoDetect": "off",
"task.quickOpen.showAll": false,
"task.saveBeforeRun": "never",
"search.quickOpen.includeHistory": true,
"search.useIgnoreFiles": false,
"typescript.tsc.autoDetect": "off",
"cmake.autoDetect": "off",
"grunt.autoDetect": "off",
"jake.autoDetect": "off",
"gulp.autoDetect": "off",
"npm.autoDetect": "off",
// C_Cpp and Worskpace exclusions and inclusions - Settings
// "C_Cpp.exclusionPolicy": "checkFilesAndFolders",
"files.readonlyInclude": {
"libraries": true, // Pointing to "libraries". FIXME: Is there any way to point to the root folder? Something like "${workspaceFolder:libraries}"?
"*/include/*": true, // FIXME: Workaround to point (*) to "libraries" repo.
"*/src/*": true // FIXME: Workaround to point (*) to "libraries" repo.
},
"C_Cpp.codeAnalysis.exclude": {
"build": true,
"install": true,
".git": true,
".svn": true,
"test/ts5": true,
"**/.vscode": true,
"**/.vs": true,
"libraries": true, // Pointing to "libraries". FIXME: Is there any way to point to the root folder? Something like "${workspaceFolder:libraries}"?
"src/specificFolder": true // Pointing to "repoWithSyntaxNotValid"
},
"C_Cpp.files.exclude": {
"build": true,
"install": true,
".git": true,
".svn": true,
"**/.vscode": true,
"**/.vs": true,
"libraries": true, // Pointing to "libraries". FIXME: Is there any way to point to the root folder? Something like "${workspaceFolder:libraries}"?
"src/specificFolder": true // Pointing to "repoWithSyntaxNotValid"
},
"search.exclude": {
"build": true,
"install": true,
".git": true,
".svn": true,
".vscode": true,
"libraries": true, // Pointing to "libraries". FIXME: Is there any way to point to the root folder? Something like "${workspaceFolder:libraries}"?
"src/specificFolder": true // Pointing to "repoWithSyntaxNotValid"
},
"files.exclude": {
"build": true,
"install": true,
".git": true,
".svn": true,
".vscode": true,
"libraries": true, // Pointing to "libraries". FIXME: Is there any way to point to the root folder? Something like "${workspaceFolder:libraries}"?
"src/specificFolder": true // Pointing to "repoWithSyntaxNotValid"
},
// TODO Tree - Settings
"todo-tree.tree.disableCompactFolders": false,
"todo-tree.tree.showBadges": false,
"todo-tree.tree.showCountsInTree": true,
"todo-tree.tree.scanMode": "current file",
"todo-tree.general.statusBar": "current file",
"todo-tree.general.tags": [
"BUG:",
"HACK:",
"FIXME:",
"TODO:",
"XXX:",
"NOTE:",
"IMPORTANT:",
"AB-NOTE:"
],
"todo-tree.general.showActivityBarBadge": true,
"todo-tree.regex.regex": "(\\*|//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)",
// SVN - Settings
"svn.diff.withHead": true,
"svn.gravatars.enabled": false,
"svn.multipleFolders.enabled": true,
"svn.autorefresh": true,
"svn.refresh.remoteChanges": true,
// C & Cpp - Settings
// "C_Cpp.intelliSenseEngineFallback": "enabled",
// "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 2, ColumnLimit: 0}",
// "C_Cpp.loggingLevel": "Debug",
// "C_Cpp.default.intelliSenseMode": "windows-gcc-x86",
// "C_Cpp.default.cStandard": "c99",
// "C_Cpp.default.cppStandard": "c++14",
"C_Cpp.dimInactiveRegions": false,
"C_Cpp.errorSquiggles": "enabled",
"C_Cpp.autocomplete": "default",
"C_Cpp.default.compilerPath": "${workspaceFolder:libraries}\\tools\\mingw-gcc-6.2.0\\bin\\gcc.exe",
"C_Cpp.intelliSenseEngine": "default",
"C_Cpp.intelliSenseMemoryLimit": 16384,
"C_Cpp.intelliSenseCacheSize": 16384,
"C_Cpp.intelliSenseEngineFallback": "enabled",
"C_Cpp.default.defines": [
"MY_DEFINES"
],
"C_Cpp.default.includePath": [
"${workspaceFolder:tests}/*/IN/*/output/generated/include",
"${workspaceFolder:tests}/*/IN/*/source",
"${workspaceFolder:libraries}/*/include",
"${workspaceFolder:libraries}/*/src",
"${workspaceFolder:libraries}/*/tools/mingw-gcc-6.2.0/i686-w64-mingw32/include"
]
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "My custom GCC debugging configs",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "${workspaceFolder:libraries}\\tools\\mingw-gcc-6.2.0\\bin\\gdb.exe",
"program": "${fileDirname}\\..\\..\\output\\bin\\${command:extension.commandvariable.file.fileDirBasename2Up}.exe",
"args": [],
"cwd": "${fileDirname}\\..\\..\\output\\bin",
"MIMode": "gdb",
"externalConsole": false,
"avoidWindowsConsoleRedirection": true,
"internalConsoleOptions": "openOnSessionStart",
"stopAtEntry": false,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"environment": [
{
"name": "SOME_VAR",
"value": "1"
}
],
"preLaunchTask": ""
}
]
}
}
Arath Burgos (@arathburgos05) Okay, looks like that only works for tag parsing if the file isn't open, but it's still parsed by IntelliSense if the file is open, i.e. we'd have to start to check that exclusion for IntelliSense or add a C_Cpp.intelliSense.exclude setting.
You could potentially exclude those particular folders with files.exclude and then re-add them back as a workspace folder with C_Cpp.intelliSenseEngine set to "Tag Parser" for those folders (you'll still get missing include blue/info warnings though).
thanks Sean McManus (@sean-mcmanus) , is there any open PR where is working " C_Cpp.intelliSense.exclude setting" feature? I want to exclude files from intellisense indexer but not from my workspace :(
Arath Burgos (@arathburgos05) There's no open PR currently, but it should be a trivial issue for us to fix, possibly even just re-using the C_Cpp.files.exclude setting, which is inherited from other settings like C_Cpp.codeAnalysis.exclude.
Colen Garoutte-Carson (@Colengms) I currently making changes in this area (IntelliSense updating), so maybe he could add this as part of that larger change for 1.19.0.
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
Activity
sean-mcmanus commentedon Nov 2, 2023
Use folder-based exclusion instead of file-based exclusion.
Does that work for you?
Using the
**at the end would require C_Cpp.exclusionPolicy to be changed (not recommended).sean-mcmanus commentedon Nov 2, 2023
Arath Burgos (@arathburgos05) Okay, looks like that only works for tag parsing if the file isn't open, but it's still parsed by IntelliSense if the file is open, i.e. we'd have to start to check that exclusion for IntelliSense or add a C_Cpp.intelliSense.exclude setting.
You could potentially exclude those particular folders with files.exclude and then re-add them back as a workspace folder with C_Cpp.intelliSenseEngine set to "Tag Parser" for those folders (you'll still get missing include blue/info warnings though).
arathburgos05 commentedon Nov 2, 2023
Sean McManus (@sean-mcmanus)
I tried not using
**but the errors shown in the first picture are still appearing. As you said, I thinkC_Cpp.intelliSense.excludeoption would be great!A question... IntelliSense is the tool which reports issues in problems sections? I would like to "skip" some specific paths from scan just keeping in the workspace for reference purposes (but not checking syntax -or reporting them- or adding macros/information to IntelliSense database).
For the moment a workaround will be move that folder to another workspace to prevent affecting me on the indexer (because due I have several copies of a file with wrong syntax then the IntelliSense is showing inexistent errors in some files due to re-definitions) like this one:

Because DUMMY_MACRO was taken by IntelliSense in files/paths that I don't want to be scanned.
A last question... Is there any way to point to workspace folders in the root for
"C_Cpp.codeAnalysis.exclude"or similar tags?for example, something like:
I can use it in vars like
"C_Cpp.default.includePath"but no in"search.exclude"and idk why or if there is any other workaround.Regards.
My configurations
my_configurations.code-workspace
Related installed extensions:

sean-mcmanus commentedon Nov 2, 2023
Arath Burgos (@arathburgos05) Yeah, I also wanted to reference a specific workspace folder in the various excludes settings -- it's being tracked by VS Code issue microsoft/vscode#50638
arathburgos05 commentedon Nov 9, 2023
thanks Sean McManus (@sean-mcmanus) , is there any open PR where is working " C_Cpp.intelliSense.exclude setting" feature? I want to exclude files from intellisense indexer but not from my workspace :(
Regards.
sean-mcmanus commentedon Nov 9, 2023
Arath Burgos (@arathburgos05) There's no open PR currently, but it should be a trivial issue for us to fix, possibly even just re-using the C_Cpp.files.exclude setting, which is inherited from other settings like C_Cpp.codeAnalysis.exclude.
sean-mcmanus commentedon Nov 9, 2023
Colen Garoutte-Carson (@Colengms) I currently making changes in this area (IntelliSense updating), so maybe he could add this as part of that larger change for 1.19.0.
github-actions commentedon Jan 9, 2024
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
github-actions commentedon Feb 2, 2025
This feature request has received enough votes to be added to our backlog.