mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Mention how to customize unsafe operation styles
I was confused about how to do this, so I filed [an issue][issue]. [issue]: rust-analyzer/rust-analyzer#8474
This commit is contained in:
parent
563d2d15b3
commit
23429a08d5
1 changed files with 18 additions and 0 deletions
|
@ -589,6 +589,24 @@ For example, mutable bindings are underlined by default and you can override thi
|
|||
}
|
||||
----
|
||||
|
||||
Most themes don't have support for styling unsafe operations differently. You can fix this by specifying custom styles in your `settings.json`:
|
||||
|
||||
[source,jsonc]
|
||||
----
|
||||
"editor.semanticTokenColorCustomizations": {
|
||||
"[Theme Name]": {
|
||||
"rules": {
|
||||
"operator.unsafe": "#ff6600",
|
||||
"function.unsafe": "#ff6600"
|
||||
"method.unsafe": "#ff6600"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
----
|
||||
|
||||
Make sure you include the brackets around the theme name. For example, use "[Ayu Dark]" to customize the theme Ayu Dark.
|
||||
|
||||
==== Special `when` clause context for keybindings.
|
||||
You may use `inRustProject` context to configure keybindings for rust projects only.
|
||||
For example:
|
||||
|
|
Loading…
Reference in a new issue