You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* main:
fix "Error rewriting command" warning triggered on startup (#2277)
Take font style of sighelp active parameter from color scheme (#2279)
Add argument "include_declaration" to "lsp_symbol_references" (#2275)
fix crash on checking excluded folders with missing project data (#2276)
Fix tagged diagnostics flickering on document changes (#2274)
Cut 1.24.0
use class for diagnostic info instead of hardcoding color (#2257)
Fix package storage path in a docstring description (#2256)
Use regular font style in sighelp popup if already highlighted by color scheme (#2259)
update note about custom color scheme rule used for diagnostics (#2254)
Copy file name to clipboardExpand all lines: docs/src/customization.md
+20-16
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ If you want to bind some action to a mouse, open `Preferences / Browser Packages
37
37
| Linux |`/User/Default (Linux).sublime-mousemap`|
38
38
| Mac |`/User/Default (OSX).sublime-mousemap`|
39
39
40
-
Here is an example mouse binding that triggers LSP's "go to symbol definition" command on pressing the <kbd>ctrl</kbd>+<kbd>left click</kbd>:
40
+
Here is an example of a mouse binding that triggers LSP's "go to symbol definition" command on pressing the <kbd>ctrl</kbd>+<kbd>left click</kbd>:
41
41
42
42
```js
43
43
[
@@ -68,23 +68,23 @@ See the [mdpopups documentation](http://facelessuser.github.io/sublime-markdown-
68
68
69
69
## Inlay Hints
70
70
71
-
The style for inlay hints is defined in a[`inlay_hints.css`](https://github.com/sublimelsp/LSP/blob/main/inlay_hints.css) file in the root directory of the LSP package.
71
+
The styles for inlay hints are defined in the[`inlay_hints.css`](https://github.com/sublimelsp/LSP/blob/main/inlay_hints.css) file in the root directory of the LSP package.
72
72
If you would like to adjust the inlay hints style, you can create an [override](https://www.sublimetext.com/docs/packages.html#overriding-files-from-a-zipped-package) for this file (a restart of Sublime Text is required to apply the changes).
73
-
But be aware that by doing this, you might miss out future changes in this file, in case of updates in a new release of the LSP package.
74
-
So consider to use a package like [OverrideAudit](https://packagecontrol.io/packages/OverrideAudit) in order to get a notification when that happens.
73
+
But be aware that by doing this, you might miss out on future changes in this file, in case of updates in a new release of the LSP package.
74
+
So consider using a package like [OverrideAudit](https://packagecontrol.io/packages/OverrideAudit) to get a notification when that happens.
75
75
76
76
## Color scheme customizations
77
77
78
78
Some features use TextMate scopes to control the colors (underline, background or text color) of styled regions in a document or popup.
79
79
Colors can be customized by adding a rule for these scopes into your color scheme.
80
80
There is an example in the [official ST documentation](https://www.sublimetext.com/docs/color_schemes.html#customization) which explains how to do that.
81
81
82
-
The following tables give an overview about the scope names used by LSP.
82
+
The following tables give an overview of the scope names used by LSP.
83
83
84
84
### Semantic Highlighting
85
85
86
86
!!! info "This feature is only available if the server has the *semanticTokensProvider* capability."
87
-
Language servers which support semantic highlighting are for example *clangd* and *rust-analyzer*.
87
+
Language servers that support semantic highlighting are for example *clangd* and *rust-analyzer*.
88
88
89
89
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.
90
90
LSP automatically adds such a rule to the built-in color schemes from Sublime Text.
@@ -101,7 +101,7 @@ If you use a custom color scheme, select `UI: Customize Color Scheme` from the C
101
101
}
102
102
```
103
103
104
-
Furthermore it is possible to adjust the colors for semantic tokens by applying a foreground color to the individual token types:
104
+
Furthermore, it is possible to adjust the colors for semantic tokens by applying a foreground color to the individual token types:
@@ -130,10 +130,10 @@ Furthermore it is possible to adjust the colors for semantic tokens by applying
130
130
131
131
By default, LSP will assign scopes based on the [scope naming guideline](https://www.sublimetext.com/docs/scope_naming.html) to each of these token types, but if you define color scheme rules for the scopes specified above, the latter will take precedence.
132
132
133
-
Language servers can also add their own custom token types, which are not defined in the protocol.
134
-
A "LSP-*" helper package (or user) can provide a "semantic_tokens" mapping in the server configuration for such additional token types, or to override the scopes used for the predefined tokens from the table above.
135
-
Keys of this mapping should be the token types and values should be the corresponding scopes.
136
-
Semantic tokens with exactly one [token modifier](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#semanticTokenModifiers) can be addressed by apending the modifier after a dot.
133
+
Language servers can also add their custom token types, which are not defined in the protocol.
134
+
An "LSP-\*" helper package (or user) can provide a `semantic_tokens` mapping in the server configuration for such additional token types, or to override the scopes used for the predefined tokens from the table above.
135
+
The keys of this mapping should be the token types and values should be the corresponding scopes.
136
+
Semantic tokens with exactly one [token modifier](https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#semanticTokenModifiers) can be addressed by appending the modifier after a dot.
137
137
138
138
```json
139
139
{
@@ -146,10 +146,10 @@ Semantic tokens with exactly one [token modifier](https://microsoft.github.io/la
146
146
```
147
147
148
148
The color for custom token types can also be adjusted via a color scheme rule for the scope `meta.semantic-token.<token-type>`, where `<token-type>` is the name of the custom token type, but with all letters lowercased (similar to the listed scopes in the table above).
149
-
To target tokens with one modifier, use the scope `meta.semantic-token.<token-type>.<token-modifier>` (all lowercased).
149
+
To target tokens with one modifier, use the scope `meta.semantic-token.<token-type>.<token-modifier>` (all lowercase).
150
150
Currently, semantic tokens with more than one modifier cannot be styled reliably.
151
151
152
-
If neither a scope for a custom token type is defined, nor a color scheme rule for this token type exists, then it will only be highlighted via the regular syntax highlighting.
152
+
If neither a scope for a custom token type is defined, nor a color scheme rule for this token type exists, then it will only be highlighted via regular syntax highlighting.
153
153
154
154
### Document Highlights
155
155
@@ -194,7 +194,7 @@ Diagnostics will also optionally include the following scopes:
194
194
|`markup.unnecessary.lsp`| Unnecessary | Unused or unnecessary code |
195
195
|`markup.deprecated.lsp`| Deprecated | Deprecated or obsolete code |
196
196
197
-
Those scopes can be used to, for example, gray-out the text color of unused code, if the server supports that.
197
+
Those scopes can be used to, for example, grayout the text color of unused code, if the server supports that.
198
198
199
199
For example, to add a custom rule for `Mariana` color scheme, select `UI: Customize Color Scheme` from the Command Palette and add the following rule:
200
200
@@ -204,13 +204,13 @@ For example, to add a custom rule for `Mariana` color scheme, select `UI: Custom
The color scheme rule only works if the "background" color is different from the global background of the scheme. So for other color schemes, ideally pick a background color that is as close as possible, but marginally different from the original background.
213
+
The color scheme rule only works if the "background" color is (marginally) different from the original color scheme background.
214
214
215
215
### Signature Help
216
216
@@ -220,6 +220,10 @@ The color scheme rule only works if the "background" color is different from the
220
220
|`variable.parameter.sighelp.lsp`| Function argument in the signature help popup |
221
221
|`variable.parameter.sighelp.active.lsp`| Function argument which is currently highlighted in the signature help popup |
222
222
223
+
!!! note
224
+
If there is no special rule for the active parameter in the color scheme, it will be rendered with bold and underlined font style.
225
+
But if the color scheme defines a different `"foreground"` color for the active parameter, the style follows the `"font_style"` property from the color scheme rule.
0 commit comments