Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ colorization broken by strings with special characters in enums #674

Open
1 task
alexr00 opened this issue Jan 28, 2025 · 0 comments
Open
1 task

C++ colorization broken by strings with special characters in enums #674

alexr00 opened this issue Jan 28, 2025 · 0 comments
Labels
High Priority Common or breaks highlighting of more than just itself

Comments

@alexr00
Copy link

alexr00 commented Jan 28, 2025

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:

//Plaintext
#include <cstdint>
#include <bit>
using uint32 = uint32_t;

enum class OperatorID : uint32 {
	UNEFFECTED = 0,

	EOS = std::bit_cast<uint32>(";\0\0"),

	COMMA = std::bit_cast<uint32>(",\0\0"),

	LINE_CMNT = std::bit_cast<uint32>("//\0"),
	BLOCK_CMNT_OPEN = std::bit_cast<uint32>("/*\0"),
	BLOCK_CMNT_CLOSE = std::bit_cast<uint32>("*/\0"),

	LIST_CLOSE = std::bit_cast<uint32>("}\0\0"),

	EFFECTED = 1,
};

It looks like:

Image

It should look like:

The strings should be highlighted as strings.

Some additional screenshots showing the scopes:

punctuation.terminator.statement.cpp
meta.enum.definition.cpp
meta.body.enum.cpp
meta.block.enum.cpp
source.cpp

Image

punctuation.separator.delimiter.comma.cpp
meta.enum.definition.cpp
meta.body.enum.cpp
meta.block.enum.cpp
source.cpp

Image

Originally filed by @BlakeKessler in microsoft/vscode#237325

@jeff-hykin jeff-hykin added the High Priority Common or breaks highlighting of more than just itself label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority Common or breaks highlighting of more than just itself
Projects
None yet
Development

No branches or pull requests

2 participants