microsoft / microsoft/vscode-cpptools

go to declaration

Open
#9,678 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Go to Definition Language Service Verified - Internal Works in VS
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and Version: windows 10
  • VS Code Version: 1.69.2
  • C/C++ Extension Version: 1.11.4
  • Other extensions you installed (and if the issue persists after disabling them):
  • If using SSH remote, specify OS of remote machine:
  • 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).

the display of all parameter declarations disappears

directory used as a project:
https://github.com/llvm/llvm-project

Bug Summary and Steps to Reproduce

directory used as a project:
https://github.com/llvm/llvm-project

the path to the file to open:
G:\llvm-project-main\llvm-project-main\clang\include\clang\Basic\CodeGenOptions.h

at the beginning of the project opening, if you hover the cursor over "setDebugInfo", all definitions of this parameter are shown
image

if you right-click on "CODEGENOPT" and select "go to declaration", then all the places where this parameter is declared will be displayed in the list
image

next comes some kind of file processing and when you hover the cursor over "CODEGENOPT", the display of the remaining parameter declarations disappears
image

also, the "go to declaration" function stops working for the "CODEGENOPT" parameter.
for the "ENUM_CODEGENOPT" parameter, the "go to declaration" function works, but other declarations of this parameter in this file stop being displayed.
image

the display of all ads disappears after the output of this debugging information to the console
image

Expected behavior
  1. it is expected that all parameter declarations will be displayed when the mouse cursor hovers over it

  2. it is expected that when you right-click on the parameter and select the "go to declaration" option, all the places where this parameter is defined will be displayed

  3. the expected behavior when hovering the cursor can be viewed in the wboq documentation generator

https://blog.weghos.com/llvm/llvm/clang/include/clang/Frontend/CodeGenOptions.h.html#34

image

Code sample and Logs
c_cpp_properties.json


{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "windows-msvc-x64"
        }
    ],
    "version": 4
}
Screenshots

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

Reproduce with the llvm-project workspace and clang/include/clang/Basic/CodeGenOptions.h, using the c_cpp_properties.json configuration shown. Start by comparing hover and Go to Declaration results for CODEGENOPT and ENUM_CODEGENOPT before and after the console debugging output appears. Done means declarations remain available and both navigation behaviors continue working after processing completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.