Skip to content

No semantic token information for macro parameters #10547

Open
@akbyrd

Description

@akbyrd

Environment

OS and Version: Windows 10 22H2 19045
VS Code Version: 1.75.1
C/C++ Extension Version: 1.14.3

Bug Summary and Steps to Reproduce

Bug Summary:

The built-in textmate grammar attempts to detect macro parameters. However, it's not particularly successful. This is a place where semantic token information from the extension would help.

In this image examples 1 and 3 are incorrect.
In example 1 param is meta.preprocessor.macro.cpp.
In example 2 #param is correctly recognized as variable.other.macro.argument.cpp. I'm unsure if it should contain the # though.
In example 3 #bar is incorrectly marked as variable.other.macro.argument.cpp.
image

I think the desired outcome here is to mark param as semantic variable.macro and map that to syntax variable.other.macro.argument.cpp, or at least something roughly equivalent. And also to not mark bar as a variable.

Configuration and Logs

N/A

Other Extensions

No response

Additional context

No response

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