You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More issues are apparent depending on the theme being used
It should look like:
Here's the snippet again with some of the issues annotated. It appears as though the parser gets confused on the first function pointer and essentially thinks all the things after it are parameters in the function pointer type.
struct foo
{
void (*bar1)() noexcept; // noexcept is entity.name.type.parameter, should be storage.modifier.special.functional.post-parameters.noexcept.cpp
void (*bar2)() noexcept; // bar2 is variable.parameter.pointer.function, should be variable.other.pointer.function.cpp
void (*bar3)() noexcept;
}; // } is meta.parameter.cpp, should be punctuationsection.block.end.bracket.curly.struct.cpp
void baz() // baz is entity.name.type.parameter.cpp, should be entity.name.function.definition.cpp
{
static_assert(false, "string");
int x = 0; // line is string.quoted.double.cpp
}
@akbyrd thank you for including the scopes, that's super helpful. I think you're right, something is confusing the function pointer pattern and then it never closes. I bet it'll be an easy fix so I'll take a look when I get the chance
Checklist
"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:
It looks like:
In latest insiders with the default theme
![image](https://private-user-images.githubusercontent.com/484784/296325088-f6eb2eb7-a002-487f-bd7b-7e428a9a85fb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0Mjk5MTYsIm5iZiI6MTcyMTQyOTYxNiwicGF0aCI6Ii80ODQ3ODQvMjk2MzI1MDg4LWY2ZWIyZWI3LWEwMDItNDg3Zi1iZDdiLTdlNDI4YTlhODVmYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOVQyMjUzMzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lMWQxMDE2NmVkNTk2OGFmNmVmYjYwMTczNDk1YTZhOWY5ZjkyNDYyYzk2MzRkNTc1YTg4ZDA1ZjJmMmFjOWMwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Hid2ZZTvUlgf6dbmQLhf-3g7jf9Yt5yheDNrnQJD2wU)
More issues are apparent depending on the theme being used
![image](https://private-user-images.githubusercontent.com/484784/296325334-5f592f45-1028-4745-a57a-5ef2f39b4070.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0Mjk5MTYsIm5iZiI6MTcyMTQyOTYxNiwicGF0aCI6Ii80ODQ3ODQvMjk2MzI1MzM0LTVmNTkyZjQ1LTEwMjgtNDc0NS1hNTdhLTVlZjJmMzliNDA3MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOVQyMjUzMzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MGVkZTg2YWFiN2MyODE5M2IyM2IwM2Y4M2VjNjU0MjVjOGYwM2ZmMzNmYTE0OTcwNTFmZTFiNzUzYTE0OTI0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.CRSOe2UsEDBUpgFVpYDoMICfBKE97gblH43cQhOR6Xs)
It should look like:
Here's the snippet again with some of the issues annotated. It appears as though the parser gets confused on the first function pointer and essentially thinks all the things after it are parameters in the function pointer type.
Originally from @akbyrd in microsoft/vscode#202365
The text was updated successfully, but these errors were encountered: