Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
docs(vscode): clarify and add details
Matthew Espino055b3e2d0b48
diff --git a/packages/web/src/routes/docs/contributors/author-a-rule/+page.md b/packages/web/src/routes/docs/contributors/author-a-rule/+page.mdindex e2feda9b6..2d34212b8 100644--- a/packages/web/src/routes/docs/contributors/author-a-rule/+page.md+++ b/packages/web/src/routes/docs/contributors/author-a-rule/+page.md@@ -123,7 +123,7 @@ insert_struct_rule!(AdjectiveOfA, true);insert_pattern_rule!(BackInTheDay, true);insert_struct_rule!(WordPressDotcom, true);insert_pattern_rule!(OutOfDate, true);-// [svp! df:+] insert_pattern_rule!(MyRule, true);+// [svp! df:+] insert_pattern_rule!(MyRule, true);```If you use a `PatternLinter`, use `insert_pattern_rule` to take advantage of Harper's aggressive caching.@@ -208,6 +208,10 @@ Every time you want to test a change, you'll have to recompile `harper-ls` and rcargo build --release # Run in the monorepo to compile `harper-ls`.```+:::note+This workflow only works if all you're changing is the Rust code. If your changes include updates to the VS Code extension or if you'd like to test your new rule's setting in VS Code by adding it to `package.json`, then you'd need to open the extension in an [Extension Development Host](./visual-studio-code#Running-the-Extension).+:::+## Elevate Your Pull RequestOnce you're satisfied with your rule, you can go ahead and elevate your pull request to mark it as "ready for review."diff --git a/packages/web/src/routes/docs/contributors/visual-studio-code/+page.md b/packages/web/src/routes/docs/contributors/visual-studio-code/+page.mdindex eeb7596d2..1b6b615c7 100644--- a/packages/web/src/routes/docs/contributors/visual-studio-code/+page.md+++ b/packages/web/src/routes/docs/contributors/visual-studio-code/+page.md@@ -7,34 +7,41 @@ This document details how to develop the Visual Studio Code extension locally. I## 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 this directory, `packages/vscode-plugin`, not the root of the Harper repository, is open.+- 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`](https://github.com/Automattic/harper/blob/master/justfile) to see exactly what running the `just` recipes below does.## Prerequisites-- Make sure to [set up your environment](./environment).+- Make sure to [set up your environment](./environment). Be sure to run `just setup` as the guide recommends, or at least `pnpm install`, to make sure the extension's dependencies are installed.+- Install the [recommended extension](https://github.com/Automattic/harper/blob/master/packages/vscode-plugin/.vscode/extensions.json), [`connor4312.esbuild-problem-matchers`](https://marketplace.visualstudio.com/items?itemName=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-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.+1. Open the Run and Debug view by selecting it from the Activity Bar or by pressing `Ctrl+Shift+D`.2. Choose `Run Extension`, if not chosen already.3. Click the play (Start Debugging) button or press `F5`.## Running the Tests-### Using VS Code's Debugger--1. Open the Run and Debug view by selecting it from the Activity Bar or by pressing `Ctrl+Shift+D`.-2. Choose `Test Extension`, if not chosen already.-3. Click the play (Start Debugging) button or press `F5`.-### Using the Command Line+You may run the following command to run the tests, this is the recommended way.+```bashjust test-vscode```+### Using VS Code's Debugger++You may also follow these steps to run the tests through your VS Code installation.++1. Open the Run and Debug view by selecting it from the Activity Bar or by pressing `Ctrl+Shift+D`.+2. Choose `Test Extension`, if not chosen already.+3. Click the play (Start Debugging) button or press `F5`.+## Packaging and Installing the Extension1. Package the extension: