Skip to content

Add note about installing ESLint globally for VS Code extension #4729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 14 additions & 23 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,45 @@

## Development Setup

You'll need to clone two repositories and set up your development environment
to before you can proceed.
1. [Fork and clone][fork] the [vscode-powershell repository](https://github.com/PowerShell/vscode-powershell).

1. [Fork and clone][fork] the [vscode-powershell repository](https://github.com/PowerShell/vscode-powershell)

2. [Fork and clone][fork] the [PowerShell Editor Services (PSES) repository](https://github.com/PowerShell/PowerShellEditorServices)
2. [Fork and clone][fork] the [PowerShell Editor Services (PSES) repository](https://github.com/PowerShell/PowerShellEditorServices).
> The `vscode-powershell` folder and the `PowerShellEditorServices` folder should be next to each other on the file
> system. Code in `vscode-powershell` looks for PSES at `../PowerShellEditorServices` if you're building locally so
> PSES must be in that location.

3. Follow the [development instructions](https://github.com/PowerShell/PowerShellEditorServices#development) for
PowerShell Editor Services. **You will need to complete this step before proceeding**.

4. Install the latest [Visual Studio Code Insiders release](https://code.visualstudio.com/insiders)
> You can also use the [standard Visual Studio Code release](https://code.visualstudio.com/). Both will work, but
> using VSCode Insiders means the extension can be developed ready for new features and changes in the next VSCode
> release.
4. Install [Node.js](https://nodejs.org/en/) 16.x or higher.

5. Install [Node.js](https://nodejs.org/en/) 16.x or higher.
5. Install [Visual Studio Code](https://code.visualstudio.com).
Open the multi-root workspace file in this repo, `extension-dev.code-workspace`.
> This has a set of recommended extensions to install and provides tasks.
> The ESLint formatter will require you to install ESLint globally, using `npm install -g eslint`.
> Otherwise VS Code will erroneously complain that it isn't able to use it to format TypeScript files.

[fork]: https://help.github.com/articles/fork-a-repo/

### Building the Code

#### From Visual Studio Code

> Press <kbd>Ctrl</kbd>+<kbd>P</kbd> and type `task build`

This will compile the TypeScript files in the project to JavaScript files.
Press <kbd>Ctrl+P</kbd> and type `task build`. Explore the other provided tasks for helpful commands.

#### From a PowerShell prompt

```powershell
Invoke-Build Build
```

### Launching the extension

#### From Visual Studio Code

> To debug the extension, press <kbd>F5</kbd>. To run the extension without debugging, press
> <kbd>Ctrl</kbd>+<kbd>F5</kbd> or <kbd>Cmd</kbd>+<kbd>F5</kbd> on macOS.
Explore the `vscode-powershell.build.ps1` file for other build targets.

#### From a command prompt
### Launching the extension

```cmd
code --extensionDevelopmentPath="c:\path\to\vscode-powershell" .
```
To debug the extension use one of the provided `Launch Extension` debug configurations (remember to rebuild first).
You can simultaneously use the `Attach to Editor Services` configuration to attach the .NET debugger to the PowerShell process running the server.
Try the `powershell.developer.editorServicesWaitForDebugger` setting to attach before startup.

## Contributing Snippets

Expand Down