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
Currently, extensions have an odd way of dimming or coloring inactive code. They add non-standard a CSS class and the class dims the code. The opacity and colors are configured in the extension settings instead of in the standard place for colors in VS Code: tokenColorCustomizations: textMateRules.
// Here's what this may look like in VS Code if the user wants to configure it."editor.tokenColorCustomizations": {"textMateRules": [{"scope": "inactive","settings": {"opacity": 0.5}}]},
In clangd, we initially implemented highlighting of inactive code as a custom semantic token type, but we found this approach to be limiting in a couple of ways:
It did not allow for whole-line styling of the inactive region, such as a greyed-out background color (example rendering below).
It stomped on foreground colors provided by the client-side coloring engine in the inactive region. (At least for semantic tokens, "editor.semanticTokenColorCustomizations" did not allow specifying a style like "opacity" which combines with foreground colors.)
We ended up using a custom protocol extension for the server to tell the client about inactive code regions. A standard version would definitely be nice (but I'm not sure that semantic tokens are the best thing to build on).
I don't know if you can do this without a visible diagnostic though (in VS Code you might be able to use the "Hint" diagnostic which I think creates a much smaller squiggle, but I'm not sure if you can avoid it entirely).
Currently, extensions have an odd way of dimming or coloring inactive code. They add non-standard a CSS class and the class dims the code. The opacity and colors are configured in the extension settings instead of in the standard place for colors in VS Code:
tokenColorCustomizations
:textMateRules
.Here are some example of how this works already.
The text was updated successfully, but these errors were encountered: