Skip to content

Hover tooltip shows comment of selected symbol instead of mouseover symbol #5635

Description

Type: LanguageService

Describe the bug

  • OS and Version: Ubuntu 20.04
  • VS Code Version: 1.45.1
  • C/C++ Extension Version: 0.28.3
  • Other extensions you installed (and if the issue persists after disabling them): Persists with all other extensions disabled.
  • Does this issue involve using SSH remote to run the extension on a remote machine?: No
  • 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).

When you have a C struct, and select one member, then mouseover another. It displays the name of the member under the cursor, but the description / comment of the selected member.

Steps to reproduce

Step 1: Paste this into the editor:

struct bug 
{
    int member1;    // comment 1
    int member2;    // comment 2



    int member3;    // comment 3
}

Step 2: Save as a C file so VS Code knows that this is C code.
Step 3: doubleclick on "member1" to select it.
Step 4: mouseover "member3".

Observe that it displays int bug::member3, with the description "comment 1"

Expected behavior
I expect it to display the description for the member under the cursor, i. e. "comment3".

Logs
-------- Diagnostics - 11.6.2020, 08:46:11
Version: 0.28.3
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c11",
    "cppStandard": "c++14",
    "intelliSenseMode": "clang-x64",
    "compilerArgs": [],
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ /tmp/asdf.c ]:
    /tmp/asdf.c
Translation Unit Configurations:
[ /tmp/asdf.c ]:
    Process ID: 1027835
    Memory Usage: 12 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /usr/local/include
        /usr/lib/llvm-10/lib/clang/10.0.0/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c11
    IntelliSense Mode: clang-x64
    Other Flags:
        --clang
        --clang_version=100000
Total Memory Usage: 12 MB

Screenshots
struct-member-bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Doc commentsAn issue related to code comments shown in hover, completion, and signature help.Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.verifiedBug has been reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions