From 23429a08d5906a91f7801a8060bf142bb0203722 Mon Sep 17 00:00:00 2001
From: Daniel Franklin <daniel@danielzfranklin.org>
Date: Mon, 12 Apr 2021 16:18:04 +0100
Subject:  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
---
 docs/user/manual.adoc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'docs/user/manual.adoc')

diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index e74b287fb..b9f29188c 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -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:
-- 
cgit v1.2.3


From 13e9fb73f9444e35c736ecc15546048c189e5a23 Mon Sep 17 00:00:00 2001
From: Daniel Franklin <daniel@danielzfranklin.org>
Date: Mon, 3 May 2021 17:54:09 +0100
Subject: Merge with semantic style section

---
 docs/user/manual.adoc | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

(limited to 'docs/user/manual.adoc')

diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index b9f29188c..7510736e9 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -589,23 +589,40 @@ 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`:
+Most themes doesn't support styling unsafe operations differently yet. You can fix this by adding overrides for the rules `operator.unsafe`, `function.unsafe`, and `method.unsafe`:
 
 [source,jsonc]
 ----
-"editor.semanticTokenColorCustomizations": {
-        "[Theme Name]": {
+{
+   "editor.semanticTokenColorCustomizations": {
+         "rules": {
+             "operator.unsafe": "#ff6600",
+             "function.unsafe": "#ff6600"
+             "method.unsafe": "#ff6600"
+         }
+    },
+}
+----
+
+In addition to the top-level rules you can specify overrides for specific themes. For example, if you wanted to use a darker text color on a specific light theme, you might write:
+
+[source,jsonc]
+----
+{
+   "editor.semanticTokenColorCustomizations": {
+         "rules": {
+             "operator.unsafe": "#ff6600"
+         },
+         "[Ayu Light]": {
             "rules": {
-                "operator.unsafe": "#ff6600",
-                "function.unsafe": "#ff6600"
-                "method.unsafe": "#ff6600"
+               "operator.unsafe": "#572300"
             }
-        }
+         }
     },
 }
 ----
 
-Make sure you include the brackets around the theme name. For example, use "[Ayu Dark]" to customize the theme Ayu Dark.
+Make sure you include the brackets around the theme name. For example, use `"[Ayu Light]"` to customize the theme Ayu Light.
 
 ==== Special `when` clause context for keybindings.
 You may use `inRustProject` context to configure keybindings for rust projects only.
-- 
cgit v1.2.3

