Visual Studio Code
This document details how to develop the Visual Studio Code extension locally. If you're interested in how it's packaged and distributed, you can check out the Release VS Code Plugin workflow.
Notes
- The extension code and its tests live in the
packages/vscode-plugin/srcdirectory. Most changes you'll need to make will be there. - VS Code can only pick up the tasks and launch configurations set in
packages/vscode-plugin/.vscodeifpackages/vscode-plugin, not the root of the Harper repository, is open. - You can look at the project's
justfileto see exactly what running thejustrecipes below does.
Prerequisites
- Make sure to set up your environment . Be sure to run
just setupas the guide recommends, or at leastpnpm install, to make sure the extension's dependencies are installed. - Install the recommended extension ,
connor4312.esbuild-problem-matchers, so VS Code can understand and run esbuild tasks. - Before running or testing the extension using VS Code's Debugger, make sure you have
harper-lsinpackages/vscode-plugin/bin. You can either manually create the directory, compileharper-ls, and put it there or you can runjust test-vscodeorjust package-vscodewhich will do that for you.
Running the Extension
Following these steps will open the extension in a new Extension Development Host window, so you can view your changes.
- Open the Run and Debug view by selecting it from the Activity Bar or by pressing
Ctrl+Shift+D. - Choose
Run Extension, if not chosen already. - Click the play (Start Debugging) button or press
F5.
Running the Tests
Using the Command Line
You may run the following command to run the tests, this is the recommended way.
just test-vscode bash
Using VS Code's Debugger
You may also follow these steps to run the tests through your VS Code installation.
- Open the Run and Debug view by selecting it from the Activity Bar or by pressing
Ctrl+Shift+D. - Choose
Test Extension, if not chosen already. - Click the play (Start Debugging) button or press
F5.
Packaging and Installing the Extension
Package the extension:
just package-vscodebashInstall the extension:
code --install-extension path/to/created/.vsixbash