Closed ti1024 closed 2 years ago
This seems to effect any string literals inside parentheses, it seems to be fixable by adding #string_context
before #parameter
in the function_parameter_context
within the json file.
Just a follow up on this, it looks like we can still reach an error state even with the fix submitted last year.
Result after existing fix:
But we can break this by simply adding whitespace before the start of the raw string:
struct S {
int x =
f( R"(some raw string literal)");
int y = 100;
const char* z = "hello";
};
Or adding another nested call:
struct S {
int x =
f(g(R"(some raw string literal)"));
int y = 100;
const char* z = "hello";
};
My current theory is that #string_context
should be under #paremeter
, rather than #function_parameter_context
.
That does seem to fix this issue
Checklist
"C_Cpp.enhancedColorization": "Disabled"
→ Not sure, see belowThe issue persists even after I add
"C_Cpp.enhancedColorization": "Disabled"
to settings.json and restart VS Code, but VS Code says thatC_Cpp.enhancedColorization
is an unknown configuration setting, so I am not sure if I am adding the setting correctly. I am using VS Code 1.51.1 on Mac.The code with a problem is:
It looks like:
Color Theme: Default Light+
It should look like:
The raw string literal should be colored like a string literal, and everything after that should not be colored like a string literal.