microsoft / microsoft/vscode-cpptools-api

Allow specific file paths in `includePath` and `browse.path` from a custom provider and `c_cpp_properties.json`

Open
#73 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

Hello,
currently only folders can be specified in browse.path and includePath.
This leads to issues in bigger projects that contain smaller sub-projects.

project
├───common_include
│   ├───foo.h
│   └───bar.h
├───target_include
│   ├───foo.h
│   └───bar.h
└───main.c

As an example, here only common_include/foo.h and target_include/bar.h are required but as only folders can be defined via browse.path and includePath both */foo.h and */bar.h files will be parsed.

This may be solved by using compile_commands.json files however this is not possible in my case.
I know all the correct files that should be used in IntelliSense however I'm unable to define them as these

browse.path: Path is not a directory: c:\path\to\common_include\foo.h
includePath: Path is not a directory: c:\path\to\target_include\bar.h

errors are raised while entering specific files (applies to both .h and .c files).

At the same time forcedInclude allows to define specific files that should be included.

Would it be possible to allow specific files to also be defined in the other settings in the c_cpp_properties.json file and by a custom provider?

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 with the c_cpp_properties.json settings for includePath and browse.path, then inspect the custom provider entry point and compare their path handling with forcedInclude. Done means specific .c and .h paths are accepted from both configuration sources without directory errors and only the requested files are parsed.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.