microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.54k stars 1.56k forks source link

Parameter tooltip shows enclosing function's entire doxygen comment #9909

Open doxxx opened 2 years ago

doxxx commented 2 years ago

Environment

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

sean-mcmanus commented 2 years ago

I've filed a bug on VS (shared code) at https://developercommunity.visualstudio.com/t/Hover-over-a-parameter-of-a-function-doc/10156418 .

doxxx commented 2 years ago

I don't have this trouble with the C# extension though, so I assumed it was specific to the C++ extension.

sean-mcmanus commented 2 years ago

Yes, it's specific to the C++ extension, but it's from shared code in the C++ implementation in VS 2022.