mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
vscode moves cursor
This commit is contained in:
parent
eda52cbc34
commit
e0a43a159d
5 changed files with 52 additions and 25 deletions
|
@ -111,6 +111,16 @@ function startServer() {
|
|||
)
|
||||
}
|
||||
)
|
||||
client.onRequest(
|
||||
new lc.RequestType<lc.Position, void, any, any>("m/moveCursor"),
|
||||
(params: lc.Position, token: lc.CancellationToken) => {
|
||||
let editor = vscode.window.activeTextEditor;
|
||||
if (editor == null) return
|
||||
if (!editor.selection.isEmpty) return
|
||||
let position = client.protocol2CodeConverter.asPosition(params)
|
||||
editor.selection = new vscode.Selection(position, position);
|
||||
}
|
||||
)
|
||||
})
|
||||
client.start();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue