]> git.lizzy.rs Git - rust.git/commitdiff
vscode: add support for light themes and color customization for syntax tree highlights
authorveetaha <veetaha2@gmail.com>
Wed, 1 Apr 2020 22:20:08 +0000 (01:20 +0300)
committerveetaha <veetaha2@gmail.com>
Wed, 1 Apr 2020 22:20:08 +0000 (01:20 +0300)
editors/code/package.json
editors/code/src/commands/syntax_tree.ts

index 146b696e9cf70ecb65ab3a6eea41350413e903cc..cf74c67755bfae8587a3543e7a90d9eba64e84d5 100644 (file)
                     "light": "#747474",
                     "highContrast": "#BEBEBE"
                 }
+            },
+            {
+                "id": "rust_analyzer.syntaxTreeBorder",
+                "description": "Color of the border displayed in the Rust source code for the selected syntax node (see \"Show Syntax Tree\" command)",
+                "defaults": {
+                    "dark": "#ffffff",
+                    "light": "#b700ff",
+                    "highContrast": "#b700ff"
+                }
             }
         ],
         "semanticTokenTypes": [
index 996c7a71697b60eece65466cfddda6501e8db010..ad98786171ed7201877aa095a1ddc9059d240c99 100644 (file)
@@ -81,8 +81,10 @@ class TextDocumentContentProvider implements vscode.TextDocumentContentProvider
 // https://code.visualstudio.com/api/extension-guides/tree-view
 class AstInspector implements vscode.HoverProvider, Disposable {
     private static readonly astDecorationType = vscode.window.createTextEditorDecorationType({
-        fontStyle: "normal",
-        border: "#ffffff 1px solid",
+        borderColor: new vscode.ThemeColor('rust_analyzer.syntaxTreeBorder'),
+        borderStyle: "solid",
+        borderWidth: "2px",
+
     });
     private rustEditor: undefined | RustEditor;