Skip to content

Commit

Permalink
Add required rule for semantic highlighting to the default color schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Nov 14, 2021
1 parent 0f3aa4a commit 2aadb1a
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 3 deletions.
8 changes: 8 additions & 0 deletions ColorSchemes/Breakers.sublime-color-scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": [
{
"scope": "meta.semantic-token",
"background": "#00000001"
}
]
}
8 changes: 8 additions & 0 deletions ColorSchemes/Celeste.sublime-color-scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": [
{
"scope": "meta.semantic-token",
"background": "#00000001"
}
]
}
8 changes: 8 additions & 0 deletions ColorSchemes/Mariana.sublime-color-scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": [
{
"scope": "meta.semantic-token",
"background": "#00000001"
}
]
}
8 changes: 8 additions & 0 deletions ColorSchemes/Monokai.sublime-color-scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": [
{
"scope": "meta.semantic-token",
"background": "#00000001"
}
]
}
8 changes: 8 additions & 0 deletions ColorSchemes/Sixteen.sublime-color-scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": [
{
"scope": "meta.semantic-token",
"background": "#00000001"
}
]
}
5 changes: 3 additions & 2 deletions LSP.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
"diagnostics_gutter_marker": "dot",

// Enable semantic highlighting in addition to standard syntax highlighting (experimental!).
// Note: Must be supported by the language server and also requires a special rule
// in the color scheme to work. Please see the documentation under
// Note: Must be supported by the language server and also requires a special rule in the
// color scheme to work. If you use none of the built-in color schemes from Sublime Text,
// please see the documentation under
// https://lsp.sublimetext.io/customization/#semantic-highlighting
// for a description about how to configure your color scheme for semantic highlighting.
"semantic_highlighting": false,
Expand Down
3 changes: 2 additions & 1 deletion docs/src/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ The following tables give an overview about the scope names used by LSP.
Language servers which support semantic highlighting are for example *clangd* and *rust-analyzer*.

In order to support semantic highlighting, the color scheme requires a special rule with a background color set for semantic tokens, which is (marginally) different from the original background.
To add such a rule to your color scheme, select `UI: Customize Color Scheme` from the Command Palette and add for example the following code:
LSP automatically adds such a rule to the built-in color schemes from Sublime Text.
If you use a custom color scheme, select `UI: Customize Color Scheme` from the Command Palette and add for example the following code:

```json
{
Expand Down

0 comments on commit 2aadb1a

Please sign in to comment.