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
{{ message }}
Repository navigation
Semantic highlighting - variables vs constants #11788
At the moment the semantic highlighting is rather limited. For example if you create a constant member variable with constexpr in a class it cannot be distinguished compared to a local variable.
The same applies to constants used in a function, for example.
Solution: Provide more information so users can colorize things differently. For example it would be nice to have the following:
variable.global.const
variable.local.const
property.const (I would prefervariable.member.const, but well property is already used)
For example:
class X {
public:
int _member;
static constexpr int memberConst = 222;
void doSomething(int param) {
int localVar = 5555;
constexpr int localConst = 1234;
// I want the following to possibly have different colors:
// _member -> member variable
// memberConst -> member constant
// param -> function parameter (visualize differently)
// localVar -> local variable
// localConst -> local constant
return _member + memberConst + param + localVar + localConst;
}
};
Hi Petr Kobalicek (@kobalicek) . Thank you for the suggestion. You might also consider opening an issue against Visual Studio, over on: https://developercommunity.visualstudio.com/home . The C/C++ Extension for VS Code shares same IntelliSense implementation as Visual Studio, which is the source of our semantic tokens. You might get some additional up-votes from the community there.
Colen Garoutte-Carson (@Colengms) There is already a lot of divergences between VS and VSCode. For example with VSCode you can use textmate scopes and override them for theming purposes, but that's just not enough for my use-cases.
If I can open a VS ticket on GitHub and link it I have no problem doing that (I would just ask you for a link in this case), but redirecting me to a different ticketing system of a different product where I would need different credentials, that's unfortunately not something I would be interested in, sorry.
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
Activity
Colengms commentedon Dec 18, 2023
Hi Petr Kobalicek (@kobalicek) . Thank you for the suggestion. You might also consider opening an issue against Visual Studio, over on: https://developercommunity.visualstudio.com/home . The C/C++ Extension for VS Code shares same IntelliSense implementation as Visual Studio, which is the source of our semantic tokens. You might get some additional up-votes from the community there.
kobalicek commentedon Dec 19, 2023
Colen Garoutte-Carson (@Colengms) There is already a lot of divergences between VS and VSCode. For example with VSCode you can use textmate scopes and override them for theming purposes, but that's just not enough for my use-cases.
If I can open a VS ticket on GitHub and link it I have no problem doing that (I would just ask you for a link in this case), but redirecting me to a different ticketing system of a different product where I would need different credentials, that's unfortunately not something I would be interested in, sorry.
github-actions commentedon Feb 18, 2024
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
github-actions commentedon Jul 12, 2025
This feature request has received enough votes to be added to our backlog.