Add one more cursor in VSCode extension

230 Views Asked by At

I'm writing a Visual Studio Code extension that should be similar to Microsoft's Live Share extension. One of the features that I would like to replicate from their extension is add one more cursor in VSCode extension for my viewers, which are connected and edit my code in the session.

I want to add a similar implementation :

1

There are 1 best solutions below

4
rioV8 On

set the editor.selections to a complete array of ranges:

editor.selections = [ new vscode.Selection(2,0,4,5), new vscode.Selection(5,2,6,0)]