Skip to content

Semantic analysis doesn't understand struct names #4086

@anatolyburakov

Description

@anatolyburakov

I'm trying to customize VSCode's semantic syntax highlighting to be more like editors i am used to. I've hit the following issue:

cpptools-semantic-analysis-struct

As can be seen from the screenshot, the TM analysis shows that the editor doesn't understand that "malloc_elem" is a struct name, and thus doesn't attempt to colorize it in any way. This is despite the fact that autocomplete appears to be working for its members, so IntelliSense does know that it's a struct:

cpptools-intellisense-struct

This is using VSCode Insiders build (CppTools extension is not Insiders build), on a Windows machine using CppTools on a remote machine over Remote SSH extension.

Diagnostic log from CppTools:

-------- Diagnostics - 8/14/2019, 10:27:20 PM
Version: 0.24.1
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**",
        "${workspaceFolder}/../build/DPDK/**"
    ],
    "defines": [
        "_GNU_SOURCE"
    ],
    "compilerPath": "/usr/bin/gcc -Wall -Werror",
    "cStandard": "c99",
    "cppStandard": "c++17",
    "intelliSenseMode": "gcc-x64",
    "forcedInclude": [
        "${workspaceFolder}/config/rte_config.h"
    ],
    "browse": {
        "limitSymbolsToIncludedHeaders": false,
        "path": [
            "${workspaceFolder}/**",
            "${workspaceFolder}/../build/DPDK/**"
        ]
    }
}
Translation Unit Mappings:
[/home/anatoly/DPDK/lib/librte_eal/common/rte_malloc.c]:
    /home/anatoly/DPDK/lib/librte_eal/common/rte_malloc.c
Translation Unit Configurations:
[/home/anatoly/DPDK/lib/librte_eal/common/rte_malloc.c]:
    Process ID: 10699
    Memory Usage: 34 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/lib/gcc/x86_64-linux-gnu/7/include
        /usr/local/include
        /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
        /usr/include/x86_64-linux-gnu
        /usr/include
        /home/anatoly/DPDK/lib/librte_eal/common/include
        /home/anatoly/DPDK/lib/librte_eal/common/include/generic
        /home/anatoly/DPDK/config
        /home/anatoly/DPDK/lib/librte_eal/linux/eal/include
        /home/anatoly/build/DPDK
    Defines:
        _GNU_SOURCE
    Forced Includes:
        /home/anatoly/DPDK/config/rte_config.h
    Standard Version: c99
    IntelliSense Mode: gcc-x64
    Other Flags:
        --gcc
        --gnu_version=70400
Total Memory Usage: 34 MB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions