|
2 | 2 |
|
3 | 3 | ## Development Setup
|
4 | 4 |
|
5 |
| -You'll need to clone two repositories and set up your development environment |
6 |
| -to before you can proceed. |
| 5 | +1. [Fork and clone][fork] the [vscode-powershell repository](https://github.com/PowerShell/vscode-powershell). |
7 | 6 |
|
8 |
| -1. [Fork and clone][fork] the [vscode-powershell repository](https://github.com/PowerShell/vscode-powershell) |
9 |
| - |
10 |
| -2. [Fork and clone][fork] the [PowerShell Editor Services (PSES) repository](https://github.com/PowerShell/PowerShellEditorServices) |
| 7 | +2. [Fork and clone][fork] the [PowerShell Editor Services (PSES) repository](https://github.com/PowerShell/PowerShellEditorServices). |
11 | 8 | > The `vscode-powershell` folder and the `PowerShellEditorServices` folder should be next to each other on the file
|
12 | 9 | > system. Code in `vscode-powershell` looks for PSES at `../PowerShellEditorServices` if you're building locally so
|
13 | 10 | > PSES must be in that location.
|
14 | 11 |
|
15 | 12 | 3. Follow the [development instructions](https://github.com/PowerShell/PowerShellEditorServices#development) for
|
16 | 13 | PowerShell Editor Services. **You will need to complete this step before proceeding**.
|
17 | 14 |
|
18 |
| -4. Install the latest [Visual Studio Code Insiders release](https://code.visualstudio.com/insiders) |
19 |
| - > You can also use the [standard Visual Studio Code release](https://code.visualstudio.com/). Both will work, but |
20 |
| - > using VSCode Insiders means the extension can be developed ready for new features and changes in the next VSCode |
21 |
| - > release. |
| 15 | +4. Install [Node.js](https://nodejs.org/en/) 16.x or higher. |
22 | 16 |
|
23 |
| -5. Install [Node.js](https://nodejs.org/en/) 16.x or higher. |
| 17 | +5. Install [Visual Studio Code](https://code.visualstudio.com). |
| 18 | + Open the multi-root workspace file in this repo, `extension-dev.code-workspace`. |
| 19 | + > This has a set of recommended extensions to install and provides tasks. |
| 20 | + > The ESLint formatter will require you to install ESLint globally, using `npm install -g eslint`. |
| 21 | + > Otherwise VS Code will erroneously complain that it isn't able to use it to format TypeScript files. |
24 | 22 |
|
25 | 23 | [fork]: https://help.github.com/articles/fork-a-repo/
|
26 | 24 |
|
27 | 25 | ### Building the Code
|
28 | 26 |
|
29 | 27 | #### From Visual Studio Code
|
30 | 28 |
|
31 |
| -> Press <kbd>Ctrl</kbd>+<kbd>P</kbd> and type `task build` |
32 |
| -
|
33 |
| -This will compile the TypeScript files in the project to JavaScript files. |
| 29 | +Press <kbd>Ctrl+P</kbd> and type `task build`. Explore the other provided tasks for helpful commands. |
34 | 30 |
|
35 | 31 | #### From a PowerShell prompt
|
36 | 32 |
|
37 | 33 | ```powershell
|
38 | 34 | Invoke-Build Build
|
39 | 35 | ```
|
40 | 36 |
|
41 |
| -### Launching the extension |
42 |
| - |
43 |
| -#### From Visual Studio Code |
44 |
| - |
45 |
| -> To debug the extension, press <kbd>F5</kbd>. To run the extension without debugging, press |
46 |
| -> <kbd>Ctrl</kbd>+<kbd>F5</kbd> or <kbd>Cmd</kbd>+<kbd>F5</kbd> on macOS. |
| 37 | +Explore the `vscode-powershell.build.ps1` file for other build targets. |
47 | 38 |
|
48 |
| -#### From a command prompt |
| 39 | +### Launching the extension |
49 | 40 |
|
50 |
| -```cmd |
51 |
| -code --extensionDevelopmentPath="c:\path\to\vscode-powershell" . |
52 |
| -``` |
| 41 | +To debug the extension use one of the provided `Launch Extension` debug configurations (remember to rebuild first). |
| 42 | +You can simultaneously use the `Attach to Editor Services` configuration to attach the .NET debugger to the PowerShell process running the server. |
| 43 | +Try the `powershell.developer.editorServicesWaitForDebugger` setting to attach before startup. |
53 | 44 |
|
54 | 45 | ## Contributing Snippets
|
55 | 46 |
|
|
0 commit comments