diff options
author | veetaha <[email protected]> | 2020-04-02 03:38:52 +0100 |
---|---|---|
committer | veetaha <[email protected]> | 2020-04-02 03:38:52 +0100 |
commit | 62ed01a1078f499c93c70025342dd869bd277d39 (patch) | |
tree | 4da720bcaa718df505816ddc7ca49cddbc3e9822 /editors/code/src | |
parent | f696df379a5dd450b3d89a8c690de5f8d78f6be2 (diff) |
vscode: add highlighting of syntax tree
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/commands/syntax_tree.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts index 996c7a716..01ab4de74 100644 --- a/editors/code/src/commands/syntax_tree.ts +++ b/editors/code/src/commands/syntax_tree.ts | |||
@@ -15,6 +15,9 @@ export function syntaxTree(ctx: Ctx): Cmd { | |||
15 | void new AstInspector(ctx); | 15 | void new AstInspector(ctx); |
16 | 16 | ||
17 | ctx.pushCleanup(vscode.workspace.registerTextDocumentContentProvider(AST_FILE_SCHEME, tdcp)); | 17 | ctx.pushCleanup(vscode.workspace.registerTextDocumentContentProvider(AST_FILE_SCHEME, tdcp)); |
18 | ctx.pushCleanup(vscode.languages.setLanguageConfiguration("ra_syntax_tree", { | ||
19 | brackets: [["[", ")"]], | ||
20 | })); | ||
18 | 21 | ||
19 | return async () => { | 22 | return async () => { |
20 | const editor = vscode.window.activeTextEditor; | 23 | const editor = vscode.window.activeTextEditor; |
@@ -36,7 +39,7 @@ export function syntaxTree(ctx: Ctx): Cmd { | |||
36 | } | 39 | } |
37 | 40 | ||
38 | class TextDocumentContentProvider implements vscode.TextDocumentContentProvider { | 41 | class TextDocumentContentProvider implements vscode.TextDocumentContentProvider { |
39 | readonly uri = vscode.Uri.parse('rust-analyzer://syntaxtree'); | 42 | readonly uri = vscode.Uri.parse('rust-analyzer://syntaxtree/tree.rast'); |
40 | readonly eventEmitter = new vscode.EventEmitter<vscode.Uri>(); | 43 | readonly eventEmitter = new vscode.EventEmitter<vscode.Uri>(); |
41 | 44 | ||
42 | 45 | ||