microsoft / microsoft/vscode-cpptools

Outline missing some symbols if within an `extern "C"` block

Open
#12,493 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Environment
  • OS and Version: Linux x64 5.15.0-113-generic snap
  • VS Code Version: 1.91.1
  • C/C++ Extension Version: v1.20.5
  • If using SSH remote, specify OS of remote machine: No
Bug Summary and Steps to Reproduce

Bug Summary:
Outline miss some symbols if the test.h has macro define,
if I delete the macro define "#ifdef __cplusplus" , all Symbols will show in the outline
test.zip

Steps to reproduce:

  1. open test.h with VS Code
  2. not all symbols in outline

Expected behavior:
show all symbols in outline
Screenshot from 2024-07-22 16-31-55

Screenshot from 2024-07-22 16-32-23

Configuration and Logs
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "linux-clang-x64"
        }
    ],
    "version": 4
}
Other Extensions

No response

Additional context

No response

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

The report provides the attached test.zip and the VS Code C/C++ outline as entry points; start by opening test.h with the reported Linux/clang configuration and compare symbols inside the #ifdef __cplusplus / extern "C" block. Done means the outline shows all symbols without removing the macro guard.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
34/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.