vscode moves cursor

This commit is contained in:
Aleksey Kladov 2018-08-16 13:46:31 +03:00
parent eda52cbc34
commit e0a43a159d
5 changed files with 52 additions and 25 deletions

View file

@ -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();
}