microsoft / microsoft/vscode-cmake-tools
[Feature] "Compile Active File" for headers
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
Request Overview
In CLion, I can do the equivalent of "Compile Active File" and it does something reasonable rather than failing saying there's no way to build headers (which is correct, of course, but useless).
To me, Something Reasonable is:
- Find the same-named
.cppor.cfile as close as possible in the file tree that has an#includethat includes the header in question. - If that fails, look for
${basename}*.{cpp,c}that includes the header (this would find test-drivers for header-only includes. - If that fails, (e.g., for a header-only header), find the closest file in the file tree that
#includes the header in question and build that.
That's the fancy way -- but better than nothing would be to find any .cpp file that includes the header in question and build that. In my mind, "Compile Active File" means "I want to see what the compiler makes of the file I'm looking at."
Related:
- #3709
- #3845
Additional Information
No response
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
The issue names no files or tests. Start by tracing the existing “Compile Active File” command and review related issues #3709 and #3845; define the source-selection behavior above, then verify the command builds a suitable includer for headers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, cpp, typescript
- Domain
- build-system, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100