microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

Add an option to support east const in inlay type hints #9553

Open saierd opened 2 years ago

saierd commented 2 years ago

Feature Request

Inlay type hints currently always use west const, like in this example:

int const a;
auto& /* const int & */ b = a;

It would be nice to provide an option to show the const on the right (int const&).

sean-mcmanus commented 2 years ago

This should be available with our pending 1.11.1 release (hopefully later today), i.e. duplicate of https://github.com/microsoft/vscode-cpptools/issues/9478 .

sean-mcmanus commented 2 years ago

Oops, I read the request incorrectly.

sean-mcmanus commented 2 years ago

The position of the "const" is obtained from our shared VS parser, so the change would probably need to be made in the VS shared component (other than attempting to do some post-process manipulation of the type text, which may not be 100% accurate), so I've filed a feature request on VS at https://developercommunity.visualstudio.com/t/C-IntelliSense-setting-to-show-const/10090282