better-cpp-syntax icon indicating copy to clipboard operation
better-cpp-syntax copied to clipboard

Provide a different scope for `throw` when used as a function exception specifier

Open akbyrd opened this issue 2 years ago • 0 comments

Checklist

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

The code with a problem is:

void Foo() throw() {}

It looks like:

image

(akbyrd.akbyrd-vsc-theme)

It should look like:

image

The issue is that throw is classified as keyword.control.throw when it is used as a function exception specifier. In this case it's not a control keyword and should be able to be highlighted in a different way compared to throw expression. To be consistent with noexcept I would guess keyword.operator.functionlike, keyword.operator.throw are reasonable scopes.

The desired behavior is similar to how default is either keyword.other.constructor or keyword.control.default.cpp based on the context in which it's used.

https://github.com/microsoft/vscode-cpptools/issues/10544

akbyrd avatar Feb 22 '23 06:02 akbyrd