vscode-tree-sitter icon indicating copy to clipboard operation
vscode-tree-sitter copied to clipboard

[Bug][Rust] Type, functions, enum

Open Geobert opened this issue 5 years ago • 3 comments

First, thanks for figuring out the Windows/Linux issue! Many little things to adjust:

  • ServerError is a type and not highlighted
  • ServerError::new, new is a function and not highlighted
  • Err and Ok are enum variant of std::result::Result, I don't know if they're supposed to be hightlighted, just pointing a difference here
  • get_user_id, user_sessions_key and transaction are functions and not hightlighted

And a question: The colors seems hardcoded, can you try to retrieve the colors from the current theme? (I know we can customize them in the meantime :) )

No tree-sitter image

Tree-sitter image

Geobert avatar May 21 '19 09:05 Geobert

It would be great if you would tackle this---there's a guide in the README.md for how to contribute, and I've tried to outline a "colorization philosophy" here.

The colors seems hardcoded, can you try to retrieve the colors from the current theme?

At the moment it is not possible to use TextMate scope colors programatically: https://github.com/microsoft/vscode/issues/32813#issuecomment-488572556

If VSCode adds a way to use TextMate scope colors in setDecorations, then we will switch to that and eliminate the treeSitter.field/function/type colors from package.json. In the meantime, the only solution is for the color themes to add treeSitter.field/function/type.

georgewfraser avatar May 21 '19 16:05 georgewfraser

BTW the tree-sitter playground is very helpful for understanding the syntax tree that we are using for colorization: https://tree-sitter.github.io/tree-sitter/playground

georgewfraser avatar May 21 '19 16:05 georgewfraser

It would be great if you would tackle this

No promise, I'm missing time on my own projects already (life, life…) and don't know a thing about JS nor Typescript (JVM and native programmer here)

Geobert avatar May 21 '19 17:05 Geobert