3815: vscode: add support for light themes in "Show Syntax Tree" command r=matklad a=Veetaha

Fixes: #3810

Co-authored-by: veetaha <veetaha2@gmail.com>
This commit is contained in:
bors[bot] 2020-04-02 07:25:03 +00:00 committed by GitHub
commit 93f21ac624
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -450,6 +450,15 @@
"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": [

View 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;