import * as vscode from 'vscode'; const activeEditor = vscode.window.activeTextEditor; if (activeEditor) { const oneCursor = new vscode.OneCursor(activeEditor.document.uri, activeEditor.selection.active); oneCursor.move('down', 1); }
import * as vscode from 'vscode'; const activeEditor = vscode.window.activeTextEditor; if (activeEditor) { const oneCursor = new vscode.OneCursor(activeEditor.document.uri, activeEditor.selection.active); oneCursor.insert('Hello, world!'); }In this example, we create a new OneCursor instance and use it to insert the text "Hello, world!" at the current cursor position. The typescript vs.editor.common.controller.onecursor OneCursor class is part of the Visual Studio Code package library.