Skip to content

Inconsistent Syntax Highlighting in defines between C and C++ #685

@joaomspires

Description

@joaomspires

Checklist

  • This problem exists even with the setting "C_Cpp.enhancedColorization": "Disabled"

If Disabling that^ makes the problem go away, then follow this to make an issue on the C++ extension:
https://github.com/microsoft/vscode-cpptools/issues/new/choose

The code with a problem is:

#ifndef ERIS_MACROS_TYPE_CASE_H
#define ERIS_MACROS_TYPE_CASE_H

#define ERIS_TYPE_CASE(A, B) switch ((eris_U64)((A).type) | ((eris_U64)((B).type) << 8)) {
#define ERIS_TYPE_WHEN(A, B) case (eris_U64)(A) | ((eris_U64)(B) << 8):
#define ERIS_TYPE_ELSE       default:
#define ERIS_TYPE_END        }

#endif

It looks like:

In C:

Image

In C++:

Image

Theme used: Default Light Modern

It should look like:

I expected the syntax highlighting in C to match that of C++.

Also, the parentheses in MY_CASE and ERIS_TYPE_WHEN are colored differently because the switch braces are in two separate macro bodies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions