github-vscode-theme
github-vscode-theme copied to clipboard
Syntax highlighting in combination with Shopify's Ruby LSP semanticHighlighting
Description
I'm using the GitHub Dark theme in VSCode. The theme seems to not be fully compatible with Shopify's Ruby LSP semantic highlighting feature.
To understand the issue, consider the following 2 screenshots.
| Normal | With Ruby LSP semanticHighlighting |
|---|---|
As you can see, when semanticHighlighting is enabled, both constant declarations & usages of constants are purple, while the latter is usually blue.
Steps to reproduce
- Open VSCode
- Install
ruby-lspVSCode extension - Install
GitHub Themefor VSCode - Enable the
GitHub Darktheme - Enable semantic syntax highlighting
- Use code like below:
# some_model.rb
class SomeModel < ApplicationRecord
MyCustomError = Class.new(StandardError)
def some_operation(some_data)
raise MyCustomError unless some_precondition?
self.something = some_data.something_else
do_some_other_thing if we_need_to?
end
private
def do_some_other_thing
# ...
end
end
Version
v6.3.4
Theme
GitHub Dark
Ruby LSP has some documentation about their semantic highlighting where they specify a token list.
For this particular "issue" the token we're interested in is the namespace one, since its the one where the color changing from blue to purple causes the most confusion.
(I actually like that method invocations are also purple now, since that differentiates from local variables.)
I was able to specify an override in VSCode by adding the following to my settings. The color I used here is from Primer: primer/color/dark -> blue -> 2. This seems to match the original.
{
"editor.semanticTokenColorCustomizations": {
"[GitHub Dark]": {
"rules": {
"namespace": "#79c0ff"
}
}
},
}
Maybe this issues are related: https://github.com/primer/github-vscode-theme/issues/335