microsoft / vscode-cpptools

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

Template function syntax highlighting not working #11612

Open FrederickAmpsUp opened 8 months ago

FrederickAmpsUp commented 8 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: When calling a template/generic function on a class or pointer type, the function name isn't highlighted yellow like with non-generic calls.

Steps to reproduce:

  1. Make a generic function
  2. Call it
  3. The name is highlighted as a variable name rather than a function name

Expected behavior: The function name is highlighted yellow rather than light blue.

    this->_shader->set_uniform<glm::mat4x4>("objectMatrix", _get_transform_matrix());
    this->_shader->use();

Configuration and Logs

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/home/frederickampsup/Documents/ebb/include"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "linux-clang-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        }
    ],
    "version": 4
}

-------- Diagnostics - 11/2/2023, 12:38:20 PM
Version: 1.17.5
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/home/frederickampsup/Documents/ebb/**",
        "/home/frederickampsup/Documents/ebb/include"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c17",
    "cppStandard": "c++14",
    "intelliSenseMode": "linux-clang-x64",
    "configurationProvider": "ms-vscode.makefile-tools",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "compilerPathInCppPropertiesJson": "/usr/bin/clang",
    "configurationProviderInCppPropertiesJson": "ms-vscode.makefile-tools",
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "/home/frederickampsup/Documents/ebb/**",
            "/home/frederickampsup/Documents/ebb/include",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
cpptools version (native): 1.17.5.0
Translation Unit Mappings:
[ /home/frederickampsup/Documents/ebb/src/mesh_renderer.cpp ]:
    /home/frederickampsup/Documents/ebb/src/mesh_renderer.cpp
    /home/frederickampsup/Documents/ebb/include/ebb/render/mesh_renderer.hpp *
    /home/frederickampsup/Documents/ebb/include/ebb/render/renderable.hpp *
    /home/frederickampsup/Documents/ebb/include/ebb/error.hpp *
[ /home/frederickampsup/Documents/ebb/src/internal.cpp ]:
    /home/frederickampsup/Documents/ebb/src/internal.cpp
    /home/frederickampsup/Documents/ebb/include/ebb/error.hpp
[ /home/frederickampsup/Documents/ebb/include/ebb/render/shader.hpp ]:
    /home/frederickampsup/Documents/ebb/include/ebb/render/shader.hpp
Translation Unit Configurations:
[ /home/frederickampsup/Documents/ebb/src/mesh_renderer.cpp ]:
    Process ID: 354548
    Memory Usage: 336 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /home/frederickampsup/Documents/ebb/include
        /usr/include/c++/13
        /usr/include/x86_64-linux-gnu/c++/13
        /usr/include/c++/13/backward
        /usr/lib/llvm-14/lib/clang/14.0.6/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
        /home/frederickampsup/Documents/ebb/include/ebb/external/glm
        /home/frederickampsup/Documents/ebb/include/ebb/external
    Standard Version: c++14
    IntelliSense Mode: linux-clang-x64
    Other Flags:
        --clang
        --clang_version=140006
[ /home/frederickampsup/Documents/ebb/src/internal.cpp ]:
    Process ID: 355972
    Memory Usage: 23 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /home/frederickampsup/Documents/ebb/include
        /usr/include/c++/13
        /usr/include/x86_64-linux-gnu/c++/13
        /usr/include/c++/13/backward
        /usr/lib/llvm-14/lib/clang/14.0.6/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c++14
    IntelliSense Mode: linux-clang-x64
    Other Flags:
        --clang
        --clang_version=140006
[ /home/frederickampsup/Documents/ebb/include/ebb/render/shader.hpp ]:
    Process ID: 356099
    Memory Usage: 10 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /home/frederickampsup/Documents/ebb/include
        /usr/include/c++/13
        /usr/include/x86_64-linux-gnu/c++/13
        /usr/include/c++/13/backward
        /usr/lib/llvm-14/lib/clang/14.0.6/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c++14
    IntelliSense Mode: linux-clang-x64
    Other Flags:
        --clang
        --clang_version=140006
        --header_only_fallback
Total Memory Usage: 371 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 26698
Number of files parsed: 1261

------- Potential include path issues --------
Some headers exist in multiple locations. If IntelliSense is behaving incorrectly,
try adding one of the alternate paths to the "includePath" in your configuration in
c_cpp_properties.json to override the automatic path discovery for that header.

Using: /usr/include/glm/glm.hpp
    Alternative: "/home/frederickampsup/Documents/ebb/include/ebb/external"

Other Extensions

No response

Additional context

No response

browntarik commented 8 months ago

Could you please provide the exact code snippet that is causing this issue for you?

FrederickAmpsUp commented 8 months ago

Updated

browntarik commented 8 months ago

Could you provide a screenshot of the code highlighting? I believe I have created a similar setup but the functions you have provided are being highlighted yellow (see below):

image

FrederickAmpsUp commented 8 months ago

image You forgot the template part of the template function...