This example shows you how to create a command that makes changes to a document (of the active text editor).
It has the command "Reverse Selected Text", which reverses the selected text.
Below are references to parts of the API used in the code.
commands.registerCommandwindow.activeTextEditorTextDocument.getTextTextEditor.editTextEditorEdit
- Run
npm installon the command-line to install the dev dependencies. - Press F5 to run the "Launch Extension" Debug Configuration. This will run the extension in a new VS Code window.
- Select the command "Reverse Selected Text" from the Command Palette (Ctrl+Shift+p).
