microsoft / microsoft/vscode-cpptools-api

Include flags with relative directories always resolve relative to workspace

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
33
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Problem

If a SourceFileConfiguration includes a entry in compilerFragments like /I..\foo, cpptools will attempt to resolve that include directory relative to the VS Code workspace root and silently discard the flag if the directory does not exist. However, it's possible that the compiler process was invoked with a different working directory than the workspace root, and the relative include directory would have resolved successfully relative to the compiler's working directory.

Suggested fix

Add a new readonly directory?: string; property to SourceFileConfiguration that specifies the working directory of the compiler process. Relative paths in compilerFragments should resolve relative to directory, if it is defined.

Contributor guide

No contributing guide indexed for this repository

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 locating the SourceFileConfiguration declaration and the code that resolves compilerFragments relative to the VS Code workspace root. Verify how compiler working directories are represented, then ensure a defined directory is used for relative include paths and that the new optional property is exposed in the public API.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.