Closed linus-skold closed 5 years ago
I'm a little concerned that generating the decorators dynamically will have performance implications. VSCode does a bunch of optimizations based on the fact that the set of decorators is fixed.
Where have you read that it does optimizations on being fixed? I'm wondering how VSCode would know that the decorator is fixed in the first place without doing static analysis? They're both being created and stored in VSCode, and if they already exist when you try to create it, it should return a color reference. I would assume that they use 'treeSitter.*' as a key and that they store the decorator in <key, value> pair.
Reduced the amount of SyntaxNode[] that are created & returned by each color function into a Map Added help functions to easily add to the colorMap Added function to create the functionStyle, typeStyle etc... from the key used to populate the colorMap. "functions" -> "treeSitter.function" and so on This makes it easier to scale and expand if more types of coloring is wanted.