From 2a221320d4c59ee8e2a39c494b51f336860bc90d Mon Sep 17 00:00:00 2001 From: Joan Rieu Date: Thu, 31 Oct 2019 20:33:10 -0400 Subject: [PATCH] Update README.md --- document-editing-sample/README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/document-editing-sample/README.md b/document-editing-sample/README.md index b450e823..506696e5 100644 --- a/document-editing-sample/README.md +++ b/document-editing-sample/README.md @@ -1,5 +1,28 @@ # Document Editing Sample -This sample shows +This is an example that shows you how to create a command which makes changes to the document in the active editor. -- How to update document in current active editor through commands. +## Demo + +![demo](demo.gif) + +## VS Code API + +### `vscode` module + +- [`commands.registerCommand`](https://code.visualstudio.com/api/references/vscode-api#commands.registerCommand) +- [`window.activeTextEditor`](https://code.visualstudio.com/api/references/vscode-api#window.activeTextEditor) +- [`TextDocument.getText`](https://code.visualstudio.com/api/references/vscode-api#TextDocument.getText) +- [`TextEditor.edit`](https://code.visualstudio.com/api/references/vscode-api#TextEditor.edit) +- [`TextEditorEdit`](https://code.visualstudio.com/api/references/vscode-api#TextEditorEdit) + +### Contribution Points + +- [`contributes.commands`](https://code.visualstudio.com/api/references/contribution-points#contributes.commands) + +## Running the Sample + +- Run `npm install` in terminal to install dependencies +- Run the `Run Extension` target in the Debug View. This will: + - Start a task `npm: watch` to compile the code + - Run the extension in a new VS Code window