microsoft / vscode-cpptools

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

First element of the QMap array is not colorized #12543

Closed ChnTamap closed 1 month ago

ChnTamap commented 1 month ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary:

When initializing a class member variable of type QMap<enum, QString>, the first element is not colorized

Steps to reproduce: Write Qt with c++

Example:

class Test {
    // ...
public:
    inline static QMap<enum Type, QString>Texts = {
        {Uint8, "uint8"},
        {Uint16, "uint16"},
        {Uint32, "uint32"},
    };
    // ...
};

Expected behavior:

CB8F86FB-AB24-4b0f-9BD3-FE70B9A7A3CE

Configuration and Logs

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/../build-Test_Qt_5_15_2_MinGW_32_bit-Release/**",
                "E:\\Qt\\5.15.2\\mingw81_32\\include",
                "E:/Qt/Tools/mingw810_32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/**",
                "E:/Qt/5.15.2/mingw81_32/include/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "windows-gcc-x86",
            "compilerPath": "E:\\Qt\\Tools\\mingw810_32\\bin\\g++"
        }
    ],
    "version": 4
}

Other Extensions

vscode.npm vscode.json-language-features vscode.extension-editing vscode.typescript-language-features vscode.git-base vscode.markdown-language-features shd101wyy.markdown-preview-enhanced vscode.emmet CodeInChinese.EnglishChineseDictionary ms-vscode.cpptools vscode.debug-auto-launch vscode.git mhutchie.git-graph vscode.merge-conflict vscode.markdown-math

Additional context

No response

sean-mcmanus commented 1 month ago

Our extension doesn't implement lexical colorization. It repros with our C/C++ extension disabled. The implementation is from VS Code itself, which gets its implementation from https://github.com/jeff-hykin/better-cpp-syntax/issues, so you should file a bug in that repo.