mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-24 12:24:11 +00:00
vscode: add highlighting of syntax tree
This commit is contained in:
parent
f696df379a
commit
62ed01a107
3 changed files with 50 additions and 1 deletions
|
@ -15,6 +15,9 @@ export function syntaxTree(ctx: Ctx): Cmd {
|
|||
void new AstInspector(ctx);
|
||||
|
||||
ctx.pushCleanup(vscode.workspace.registerTextDocumentContentProvider(AST_FILE_SCHEME, tdcp));
|
||||
ctx.pushCleanup(vscode.languages.setLanguageConfiguration("ra_syntax_tree", {
|
||||
brackets: [["[", ")"]],
|
||||
}));
|
||||
|
||||
return async () => {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
|
@ -36,7 +39,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
|
|||
}
|
||||
|
||||
class TextDocumentContentProvider implements vscode.TextDocumentContentProvider {
|
||||
readonly uri = vscode.Uri.parse('rust-analyzer://syntaxtree');
|
||||
readonly uri = vscode.Uri.parse('rust-analyzer://syntaxtree/tree.rast');
|
||||
readonly eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue