microsoft / microsoft/vscode-cpptools

Parameter tooltip shows enclosing function's entire doxygen comment

Open
#9,909 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement Feature: Doc comments 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: Windows 10
  • VS Code Version: 1.71.2
  • C/C++ Extension Version: 1.12.4
Bug Summary and Steps to Reproduce

Bug Summary: Parameter tooltip shows enclosing function's entire doxygen comment

Steps to reproduce:

  1. Define a C/C++ function with parameters and a doxygen comment that documents each parameter.
  2. Add some code to the function that references one of the parameters.
  3. Hover of the parameter reference.

Actual: The entire doxygen comment for the function is displayed in the tooltip.
Expected: Only the documentation for that specific parameter is displayed.

Expected behavior

The tooltip for a function parameter should only display the doxygen documentation for that parameter, not the enclosing function.

Code sample and Logs
Code sample:

/// @brief Configures the console command line service.
/// @param console Console interface.
/// @param commandRegistry Registry of commands.
static void ConfigureConsoleCommandLine(Console *console, CommandRegistry *commandRegistry)
{
    static ConsoleCommandLine cmdline(console, commandRegistry);
    cmdline.Start();
}

c_cpp_properties.json:
{
    "configurations": [
        {
            "name": "ARM",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "DeviceFamily_MSP432E401Y",
                "__MSP432E401Y__"
            ],
            "intelliSenseMode": "gcc-arm",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

C/C++ Diagnostics:
-------- Diagnostics - 2022-09-23, 11:50:58 a.m.
Version: 1.12.4
Current Configuration:
{
    "name": "ARM",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [
        "DeviceFamily_MSP432E401Y",
        "__MSP432E401Y__"
    ],
    "intelliSenseMode": "gcc-arm",
    "configurationProvider": "ms-vscode.cmake-tools",
    "compilerPathIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "intelliSenseModeIsExplicit": true,
    "macFrameworkPath": [],
    "windowsSdkVersion": "10.0.19041.0",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "mergeConfigurations": false,
    "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-5/cmsis/core/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/ti/devices/msp432e4/driverlib",
        "c:/users/gordon.tyler/dev/msp432-cmake/build/cmakefiles",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/freertos/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-5/cmsis/rtos2/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/source/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/source/portable/gcc/arm_cm4f",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/cmsis/rtos2/freertos/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/source",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/source/portable/memmang",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/cmsis/rtos2/freertos/source",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/freertos/src",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/ports/freertos/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/ports/msp432e4/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/lwip/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/ports/freertos",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/ports/msp432e4/netif",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/api",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/apps/sntp",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/core",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/core/ipv4",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/netif",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/startup/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/startup/src",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/miros/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/miros/src",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/telnet/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/telnet/src",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/core/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/core/src",
        "c:/users/gordon.tyler/dev/msp432-cmake/app/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/app/src",
        "c:/users/gordon.tyler/dev/msp432-cmake/app-miros/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/app-miros/src"
    ],
    "compilerPath": "c:/tools/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/arm-none-eabi-g++.exe",
    "compilerArgs": [],
    "compilerFragments": [
        "-Wno-register -mcpu=cortex-m4 -march=armv7e-m -mthumb -mlittle-endian -mfloat-abi=hard -mfpu=fpv4-sp-d16                     --specs=nosys.specs --specs=nano.specs                     -ffunction-sections -fdata-sections -fstack-usage                     -Wall -Wno-address-of-packed-member                     -DDeviceFamily_MSP432E401Y -D__MSP432E401Y__  -DDEBUG -gdwarf-3 -gstrict-dwarf -g"
    ]
}
Custom configurations:
[ C:\Users\gordon.tyler\dev\msp432-cmake\app\src\main.cpp ]
{
    "includePath": [
        "c:/users/gordon.tyler/dev/msp432-cmake/app/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-5/cmsis/core/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/core/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/freertos/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-5/cmsis/rtos2/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/source/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/source/portable/gcc/arm_cm4f",
        "c:/users/gordon.tyler/dev/msp432-cmake/thirdparty/cmsis-freertos/cmsis/rtos2/freertos/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/src/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/ports/freertos/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/dependencies/ti-msp432e4-sdk/third_party/lwip/ports/msp432e4/include",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/lwip/inc",
        "c:/users/gordon.tyler/dev/msp432-cmake/libs/telnet/inc"
    ],
    "defines": [],
    "compilerPath": "c:/tools/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/arm-none-eabi-g++.exe",
    "compilerArgs": [],
    "compilerFragments": [
        "-Wno-register -mcpu=cortex-m4 -march=armv7e-m -mthumb -mlittle-endian -mfloat-abi=hard -mfpu=fpv4-sp-d16                     --specs=nosys.specs --specs=nano.specs                     -ffunction-sections -fdata-sections -fstack-usage                     -Wall -Wno-address-of-packed-member                     -DDeviceFamily_MSP432E401Y -D__MSP432E401Y__  -DDEBUG -gdwarf-3 -gstrict-dwarf -g"
    ]
}
Translation Unit Mappings:
[ C:\Users\gordon.tyler\dev\msp432-cmake\app\src\main.cpp ]:
    C:\Users\gordon.tyler\dev\msp432-cmake\app\src\main.cpp
Translation Unit Configurations:
[ C:\Users\gordon.tyler\dev\msp432-cmake\app\src\main.cpp ]:
    Process ID: 43088
    Memory Usage: 153 MB
    Compiler Path: c:/tools/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi/bin/arm-none-eabi-g++.exe
    Includes:
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\APP\INC
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\THIRDPARTY\CMSIS-5\CMSIS\CORE\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\DEPENDENCIES\TI-MSP432E4-SDK
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\LIBS\CORE\INC
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\LIBS\FREERTOS\INC
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\THIRDPARTY\CMSIS-5\CMSIS\RTOS2\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\THIRDPARTY\CMSIS-FREERTOS\SOURCE\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\THIRDPARTY\CMSIS-FREERTOS\SOURCE\PORTABLE\GCC\ARM_CM4F
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\THIRDPARTY\CMSIS-FREERTOS\CMSIS\RTOS2\FREERTOS\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\DEPENDENCIES\TI-MSP432E4-SDK\THIRD_PARTY\LWIP\SRC\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\DEPENDENCIES\TI-MSP432E4-SDK\THIRD_PARTY\LWIP\PORTS\FREERTOS\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\DEPENDENCIES\TI-MSP432E4-SDK\THIRD_PARTY\LWIP\PORTS\MSP432E4\INCLUDE
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\LIBS\LWIP\INC
        C:\USERS\GORDON.TYLER\DEV\MSP432-CMAKE\LIBS\TELNET\INC
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\ARM-NONE-EABI\INCLUDE\NEWLIB-NANO
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\ARM-NONE-EABI\INCLUDE\C++\11.3.1
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\ARM-NONE-EABI\INCLUDE\C++\11.3.1\ARM-NONE-EABI\THUMB\V7E-M+FP\HARD
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\ARM-NONE-EABI\INCLUDE\C++\11.3.1\BACKWARD
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\LIB\GCC\ARM-NONE-EABI\11.3.1\INCLUDE
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\LIB\GCC\ARM-NONE-EABI\11.3.1\INCLUDE-FIXED
        C:\TOOLS\ARM-GNU-TOOLCHAIN-11.3.REL1-MINGW-W64-I686-ARM-NONE-EABI\ARM-NONE-EABI\INCLUDE
    Defines:
        DeviceFamily_MSP432E401Y
        __MSP432E401Y__
        DEBUG
    Standard Version: c++17
    IntelliSense Mode: windows-gcc-arm
    Other Flags:
        --g++
        --gnu_version=110301
Total Memory Usage: 153 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5919
Number of files parsed: 173
Screenshots

Function definition:

image

Tooltip when hovering over commandRegistry:

image

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 the hover in app/src/main.cpp using the ConfigureConsoleCommandLine example and its @param comments. Trace the C/C++ extension's parameter-tooltip entry point; done means hovering console or commandRegistry shows only that parameter's documentation, rather than the full function comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
devtools
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.