|
2 | 2 |
|
3 | 3 | ## What's in the folder
|
4 | 4 |
|
5 |
| -- This folder contains all of the files necessary for your extension. |
6 |
| -- `package.json` - this is the manifest file in which you declare your |
7 |
| - extension and command. |
8 |
| - - The sample plugin registers a command and defines its title and command |
9 |
| - name. With this information VS Code can show the command in the command |
10 |
| - palette. It doesn’t yet need to load the plugin. |
11 |
| -- `src/extension.ts` - this is the main file where you will provide the |
12 |
| - implementation of your command. |
13 |
| - - The file exports one function, `activate`, which is called the very |
14 |
| - first time your extension is activated (in this case by executing the |
15 |
| - command). Inside the `activate` function we call `registerCommand`. |
16 |
| - - We pass the function containing the implementation of the command as the |
17 |
| - second parameter to `registerCommand`. |
| 5 | +- This folder contains all of the files necessary for your extension. |
| 6 | +- `package.json` - this is the manifest file in which you declare your extension |
| 7 | + and command. |
| 8 | + - The sample plugin registers a command and defines its title and command |
| 9 | + name. With this information VS Code can show the command in the command |
| 10 | + palette. It doesn’t yet need to load the plugin. |
| 11 | +- `src/extension.ts` - this is the main file where you will provide the |
| 12 | + implementation of your command. |
| 13 | + - The file exports one function, `activate`, which is called the very first |
| 14 | + time your extension is activated (in this case by executing the command). |
| 15 | + Inside the `activate` function we call `registerCommand`. |
| 16 | + - We pass the function containing the implementation of the command as the |
| 17 | + second parameter to `registerCommand`. |
18 | 18 |
|
19 | 19 | ## Get up and running straight away
|
20 | 20 |
|
21 |
| -- Press `F5` to open a new window with your extension loaded. |
22 |
| -- Run your command from the command palette by pressing (`Ctrl+Shift+P` or |
23 |
| - `Cmd+Shift+P` on Mac) and typing `Hello World`. |
24 |
| -- Set breakpoints in your code inside `src/extension.ts` to debug your |
25 |
| - extension. |
26 |
| -- Find output from your extension in the debug console. |
| 21 | +- Press `F5` to open a new window with your extension loaded. |
| 22 | +- Run your command from the command palette by pressing (`Ctrl+Shift+P` or |
| 23 | + `Cmd+Shift+P` on Mac) and typing `Hello World`. |
| 24 | +- Set breakpoints in your code inside `src/extension.ts` to debug your |
| 25 | + extension. |
| 26 | +- Find output from your extension in the debug console. |
27 | 27 |
|
28 | 28 | ## Make changes
|
29 | 29 |
|
30 |
| -- You can relaunch the extension from the debug toolbar after changing code in |
31 |
| - `src/extension.ts`. |
32 |
| -- You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with |
33 |
| - your extension to load your changes. |
| 30 | +- You can relaunch the extension from the debug toolbar after changing code in |
| 31 | + `src/extension.ts`. |
| 32 | +- You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your |
| 33 | + extension to load your changes. |
34 | 34 |
|
35 | 35 | ## Explore the API
|
36 | 36 |
|
37 |
| -- You can open the full set of our API when you open the file |
38 |
| - `node_modules/@types/vscode/index.d.ts`. |
| 37 | +- You can open the full set of our API when you open the file |
| 38 | + `node_modules/@types/vscode/index.d.ts`. |
39 | 39 |
|
40 | 40 | ## Run tests
|
41 | 41 |
|
42 |
| -- Install the |
43 |
| - [`Extension Test Runner`](HTTPS://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner) |
44 |
| -- Run the "watch" task via the **Tasks: Run Task** command. Make sure this is |
45 |
| - running, or tests might not be discovered. |
46 |
| -- Open the Testing view from the activity bar and click the Run Test" button, |
47 |
| - or use the hotkey `Ctrl/Cmd + ; A` |
48 |
| -- See the output of the test result in the Test Results view. |
49 |
| -- Make changes to `src/test/extension.test.ts` or create new test files inside |
50 |
| - the `test` folder. |
51 |
| - - The provided test runner will only consider files matching the name |
52 |
| - pattern `**.test.ts`. |
53 |
| - - You can create folders inside the `test` folder to structure your tests |
54 |
| - any way you want. |
| 42 | +- Install the |
| 43 | + [`Extension Test Runner`](HTTPS://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner) |
| 44 | +- Run the "watch" task via the **Tasks: Run Task** command. Make sure this is |
| 45 | + running, or tests might not be discovered. |
| 46 | +- Open the Testing view from the activity bar and click the Run Test" button, or |
| 47 | + use the hotkey `Ctrl/Cmd + ; A` |
| 48 | +- See the output of the test result in the Test Results view. |
| 49 | +- Make changes to `src/test/extension.test.ts` or create new test files inside |
| 50 | + the `test` folder. |
| 51 | + - The provided test runner will only consider files matching the name |
| 52 | + pattern `**.test.ts`. |
| 53 | + - You can create folders inside the `test` folder to structure your tests |
| 54 | + any way you want. |
55 | 55 |
|
56 | 56 | ## Go further
|
57 | 57 |
|
58 |
| -- [`Follow UX guidelines`](HTTPS://code.visualstudio.com/api/ux-guidelines/overview) |
59 |
| - to create extensions that seamlessly integrate with VS Code's native |
60 |
| - interface and patterns. |
61 |
| -- Reduce the extension size and improve the startup time by |
62 |
| - [`bundling your extension`](HTTPS://code.visualstudio.com/api/working-with-extensions/bundling-extension). |
63 |
| -- [`Publish your extension`](HTTPS://code.visualstudio.com/api/working-with-extensions/publishing-extension) |
64 |
| - on the VS Code extension marketplace. |
65 |
| -- Automate builds by setting up |
66 |
| - [`Continuous Integration`](HTTPS://code.visualstudio.com/api/working-with-extensions/continuous-integration). |
67 |
| -- Integrate to the |
68 |
| - [`report issue`](HTTPS://code.visualstudio.com/api/get-started/wrapping-up#issue-reporting) |
69 |
| - flow to get issue and feature requests reported by users. |
| 58 | +- [`Follow UX guidelines`](HTTPS://code.visualstudio.com/api/ux-guidelines/overview) |
| 59 | + to create extensions that seamlessly integrate with VS Code's native interface |
| 60 | + and patterns. |
| 61 | +- Reduce the extension size and improve the startup time by |
| 62 | + [`bundling your extension`](HTTPS://code.visualstudio.com/api/working-with-extensions/bundling-extension). |
| 63 | +- [`Publish your extension`](HTTPS://code.visualstudio.com/api/working-with-extensions/publishing-extension) |
| 64 | + on the VS Code extension marketplace. |
| 65 | +- Automate builds by setting up |
| 66 | + [`Continuous Integration`](HTTPS://code.visualstudio.com/api/working-with-extensions/continuous-integration). |
| 67 | +- Integrate to the |
| 68 | + [`report issue`](HTTPS://code.visualstudio.com/api/get-started/wrapping-up#issue-reporting) |
| 69 | + flow to get issue and feature requests reported by users. |
0 commit comments