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/src directory. 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/.vscode if packages/vscode-plugin, not the root of the Harper repository, is open.
You can look at the project's justfile to see exactly what running the just recipes below does.
Prerequisites
Make sure to set up your environment. Be sure to run just setup as the guide recommends to make sure the extension's dependencies are installed.
Before running or testing the extension using VS Code's Debugger, make sure you have harper-ls in packages/vscode-plugin/bin. You can either manually create the directory, compile harper-ls, and put it there or you can run just test-vscode or just package-vscode which 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
Using VS Code's Debugger
Remember: VS Code can only pick up the tasks and launch configurations set in packages/vscode-plugin/.vscode if packages/vscode-plugin, not the root of the Harper repository, is open.
That means you need to manually open VS Code in the vscode-plugin directory yourself.
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.
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
packages/vscode-plugin/srcdirectory. Most changes you'll need to make will be there.packages/vscode-plugin/.vscodeifpackages/vscode-plugin, not the root of the Harper repository, is open.justfileto see exactly what running thejustrecipes below does.Prerequisites
just setupas the guide recommends to make sure the extension's dependencies are installed.connor4312.esbuild-problem-matchers, so VS Code can understand and run esbuild tasks.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.
Ctrl+Shift+D.Run Extension, if not chosen already.F5.Running the Tests
Using the Command Line
You may run the following command to run the tests, this is the recommended way.
Using VS Code's Debugger
Remember: 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. That means you need to manually open VS Code in thevscode-plugindirectory yourself.You may also follow these steps to run the tests through your VS Code installation.
Ctrl+Shift+D.Test Extension, if not chosen already.F5.Packaging and Installing the Extension
Package the extension:
Install the extension: