microsoft / microsoft/vscode-cpptools

Add possibility to exclude files from parser but not from file list in Workspace.

Open
#11,609 9 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Language Service quick fix
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Feature Request

📄 Brief introduction

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:

"files.readonlyInclude": {
  "*/oneFolder/anotherFolder/**": true
},
"C_Cpp.codeAnalysis.exclude": {
  "*/oneFolder/anotherFolder/**": true
},
"C_Cpp.files.exclude": {
  "*/oneFolder/anotherFolder/**": true
},
"search.exclude": {
  "*/oneFolder/anotherFolder/**": true
},
"files.exclude": {
  "*/oneFolder/anotherFolder/**": true
}

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:
image

🛠 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how C_Cpp.files.exclude, C_Cpp.codeAnalysis.exclude, and files.exclude affect workspace visibility, parsing, and reported problems. The change is complete when a glob-based setting can suppress parser or syntax problems for matching files while keeping those files visible in the workspace.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.