microsoft / microsoft/vscode-cpptools

IntelliSense: suggest definitions in not-yet-included file

Open
#4,776 5 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Auto-complete Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Currently (please correct me if I'm wrong), it seems VSCode will not suggest definitions that are not yet included in the source file. This is despite the fact that the definitions reside in header files in includePath. Example below.

For instance, say I wanted to create an instance of std::map in my source file. I have not yet added #include <map> at the top of my source file.

In some other C++ IDEs, a code suggestion will appear for std::map when I start typing it (see NetBeans example below). If I choose to accept the suggestion, #include <map> is automatically added at the top of my source file.

image

In VSCode, however, I'm not getting this suggestion unless I add #include <map> first.

image

Suggestion: Enable IntelliSense to suggest definitions that are (not yet) included in the source file.
Automatically add #include (relevant header) when accepting such a suggestion.

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 locating the IntelliSense completion and include-handling entry points in this repository; the issue names no files or tests. Done means suggestions can find definitions in configured headers not yet included and accepting one adds the relevant include.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.