Closed Sawtaytoes closed 3 years ago
I think there's already an extension that goes in the direction you want: https://marketplace.visualstudio.com/items?itemName=MatthewNespor.vscode-color-identifiers-mode?
Maybe connect with the author from the extension to help and join forces.
I think there's already an extension that goes in the direction you want: https://marketplace.visualstudio.com/items?itemName=MatthewNespor.vscode-color-identifiers-mode?
Maybe connect with the author from the extension to help and join forces.
That's a good plan. I'll take a look.
The important piece for me is the existence of these docs: https://code.visualstudio.com/api/language-extensions/language-server-extension-guide.
I had no clue a language server even existed.
I've been scouring the API docs trying to find an event listener to register that listens for keystrokes and gives access to the document.
I searched and looked through all issues relating to Semantic Highlighting and found none about this particular topic.
I want to add word-based Semantic Highlighting to VS Code. This is not the same as token-based Semantic Highlighting which is already part of VS Code.
NOTE: I've been using the Colorcoder plugin for Sublime Text, a Semantic Highlighting plugin, since 2013.
What is Semantic Highlighting?
Semantic Highlighting is a revolutionary way of highlighting code not by syntax selectors or token names, but by variable names. In this way, a variable
fun
would be colored the same no matter where it appeared in the code. Even.fun
would have the same coloring.It's a fundamentally different way of highlighting; although, it's different from, and works side-by-side with syntax highlighting.
Prior Art
These are own sources showing Colorcoder in action in Sublime Text:
There were a bunch of articles written on Semantic Highlighting from 2013-2014:
Implementations:
Colorcoder for Sublime Text
This is the plugin I still use today.
It has 2 modes:
Thinking about it, the theme file modifications most-likely don't even need to be there and could be generated on-the-fly or statically added to the Colorcoder plugin's Python file.
There are a few reasons this solution no longer works for me:
VS Code Implementation Ideas
I've looked at possible methods of implementing Semantic Highlighting in VS Code, but I'm not sure where to start:
webview
API and make my own text renderer. This could work, but would be me making my own VS Code at that point.If anyone knows where to point me on how I can get this into VS Code, that would be incredible. To me, this is an accessibility feature that assists with my ability to read, understand, and skim code.
If I can get this integrated into VS Code core, then it's only a setting away to turn it on. At that point, it'll no longer be this niche idea that died in 2015.