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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user