I am writing a vscode extension. I use the following code to enter text in the TextEditor area.
function insertText(params: string) {
var editor = vscode.window.activeTextEditor;
editor.edit(edit =>
editor.selections.forEach(selection => {
edit.delete(selection);
edit.insert(selection.start, params);
})
);
}
BUT, what I need my extension to be able to enter text in areas like:
- command palette
- input area when I press Ctrl+G (for
workbench.action.gotoLine
command)
instead of asking for user input.
tl;dr
pseudocode for what I am asking:
openCommandPallete();
enterTextInCommandPallete("ABCDEF");