microsoft / microsoft/vscode-cpptools
Code Analysis for "All File" and "Open files" will incorrectly use the active file's workspace folder settings
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
In multiroot scenarios, the "All Files" and "Open Files" Code Analysis options appear to use the active file's workspace folder for code analysis settings. This results in inconsistent Code Analysis results, depending on which file is active and which workspace folder it's associated with. It may also result in a crash, if the extension was activated without a file becoming active (such as opening c_cpp_properties.json), in which case there is no active file and the workspace folder used will be null (leading to a null deference).
Currently, this issue is minimized by the fact that our active file is never cleared out properly. I need to address that in the context of other changes, to avoid invalid scenarios such as non-visible or unopen files still being considered 'active'.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the multiroot case with the "All Files" and "Open Files" Code Analysis options, including activation while opening c_cpp_properties.json. Trace how the active file selects the workspace folder for analysis; done means results no longer depend on the active file and activation without one does not cause a null dereference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100