mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Add vscode support for range in SyntaxTreeParams
This enables the client to use a command to either show the live-updating version of the syntax tree for the current file. Or optionally when a selected range is provided, we then provide a snapshot of the syntax tree for the range.
This commit is contained in:
parent
ac52d9a1f1
commit
c2d3203d0c
3 changed files with 41 additions and 11 deletions
|
@ -52,7 +52,6 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
registerCommand('rust-analyzer.collectGarbage', () =>
|
||||
Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null)
|
||||
);
|
||||
registerCommand('rust-analyzer.syntaxTree', commands.syntaxTree.handle);
|
||||
registerCommand(
|
||||
'rust-analyzer.extendSelection',
|
||||
commands.extendSelection.handle
|
||||
|
@ -109,6 +108,11 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
)
|
||||
);
|
||||
|
||||
registerCommand(
|
||||
'rust-analyzer.syntaxTree',
|
||||
commands.syntaxTree.createHandle(textDocumentContentProvider)
|
||||
);
|
||||
|
||||
vscode.workspace.onDidChangeTextDocument(
|
||||
events.changeTextDocument.createHandler(textDocumentContentProvider),
|
||||
null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue