Closed eterlan closed 6 months ago
what you're probably wanting is semantic highlighting textmate should only be used for basic items as it is tokenizes everything line by line and cant jump around
To support what RedCMD said, finding local variables is impossible for Textmate parser to do reliably for languages like python/C++/Java/JavaScript. It's only realistic when local variables always start/end with something like $
.
You'll need to use an LSP, or some other custom parser to get information about local variables. If you want to highlight them, there is a "decorations" API in VS Code you can use.
Please help! I just study this whole day and cannot get the job done..
https://regex101.com/r/9siVIE/1 this works, but how to use this variable to find its usages inside function?