better-cpp-syntax
better-cpp-syntax copied to clipboard
String literals aren't handled correctly with this sample C++ code
Checklist
- [Yes] This problem exists even with the setting
"C_Cpp.enhancedColorization": "Disabled"
- [No] This bug exists for C
- [Yes] This bug exists for C++
- [?] This bug exists for Objective-C
- [?] This bug exists for Objective-C++
The code with a problem is:
#define A
struct foo
{
/*d*/ void func(const char* c)
{
#ifdef FOO
int i;
#else
func("" A ")");
#endif
}
};
It looks like:
It should look like:
Originally reported at https://github.com/microsoft/vscode-cpptools/discussions/7627
This one is going to be tough to fix correctly
- Having the
{
on the next line makes it where textmate has no idea that it is inside of a function definition. - so then it thinks that
func(""
is part of a constuctor. Inside of the constuctor"" A
isn't valid - instead its looking for type definitions and parameters
As with all things, there might be a hacky solution I'm not thinking of.