microsoft / microsoft/vscode-cpptools

Add #include "file.h" is incorrectly suggested instead of <file.h> for subDir/file.h

Open
#12,002 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Add '#include' Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

See the screenshot -- test2 is on the includePath and the current file is at the root, so it should be suggesting <file.h> since file.h is not in the same folder as the source file.

image

The issue in inherited from Visual Studio (shared code).

It was found after adding a test case for https://github.com/microsoft/vscode-cpptools/issues/11989

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 reproducing the include suggestion behavior described for the root source file and subDir/file.h. Review the test case mentioned for issue #11989 and use it to verify that an include-path header outside the source file's folder is suggested with angle brackets rather than quotes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.