microsoft / microsoft/vscode-cpptools

Intellisense does not work as expected when too many header files included

Open
#8,610 22 comments 1 reaction 1 assignee View on GitHub

@michelleangela is already working on this.

Since Jan 7, 2022.

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

Description

Bug type: Language Service

Describe the bug

  • OS and Version: Windows 11 22000
  • VS Code Version: 1.63.2 (I have tried the insider version, the results are the same)
  • C/C++ Extension Version: 1.7.1
  • If using SSH remote, specify OS of remote machine: I use Remote - WSL and the OS of WSL2 Ubuntu 20.04
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

I was working on a gazebo plugin for ROS2. In some source files, the Intellisense stops work properly. After some attempts, I found a minimum source file to reproduce the problem:

#include <gazebo/common/Plugin.hh>

static double test(void)
{
    double aaaa = 1.0, bbbb=2.0;
    double c = aa // Use hot key here to get suggestion list from Intellisense
}

When the header file <gazebo/common/Plugin.hh>(https://github.com/arpg/Gazebo/blob/master/gazebo/common/Plugin.hh) is not included, the Intellisense works as expected. However, if <gazebo/common/Plugin.hh> is included, the Intellisense still works but not as expected, as shown in the following images:

Good:
image
Bad:
image

Then I tried expanding the <gazebo/common/Plugin.hh>. It seems the problem is not caused by a specific header file, but the number of header files. When too many header files are included, Intellisense stops work as expected, as shown in the following images:

Good:
image
Still good:
image
Bad:
image

I have tried setting Intellisense memory limit and cache size:

"C_Cpp.intelliSenseMemoryLimit": 16384,
"C_Cpp.intelliSenseCacheSize": 100000000000,

No thing changed.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.