-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #755 from mcecode/integration-docs
docs: update integrations section
- Loading branch information
Showing
15 changed files
with
422 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,9 @@ | ||
# Harper for VS Code | ||
|
||
Harper is the next-generation grammar checker for your code. It catches common stylistic errors, as well as complex grammatical or layout-related problems. It works for almost [all common programming languages](./language-server#Supported-Languages) and a number of markup formats. | ||
Harper is the next-generation grammar checker for your code. It catches common stylistic errors, as well as complex grammatical or layout-related problems. It works for almost [all common programming languages](https://writewithharper.com/docs/integrations/language-server#Supported-Languages) and a number of markup formats. | ||
|
||
If you use Rust, Java, JavaScript, or any number of other programming languages, your comments may end up as part of your API's documentation. If that's the case, grammatical mistakes in your code could be down-ranking your site on search results and tarnishing your reputation for quality. | ||
|
||
Most importantly, Harper runs on-device and uses barely any memory at all. That means you can get feedback on your work in milliseconds, dramatically increasing your iteration speed. | ||
|
||
## Installation | ||
|
||
Installation should be relatively straightforward. | ||
It just depends on which editor and marketplace you're using. | ||
|
||
If you use the official Microsoft Visual Studio Code release, go ahead and go to the marketplace and search for "Harper" and click "Install". | ||
You can also visit our [official page](https://marketplace.visualstudio.com/items?itemName=elijah-potter.harper&ssr=false#overview). | ||
|
||
If you use OpenVSX, for instance if you use VSCodium, you'll want to install from [here](https://open-vsx.org/extension/elijah-potter/harper). | ||
|
||
### Commands | ||
|
||
| Command | Id | Description | | ||
| ------------------------------- | ------------------------------- | ------------------- | | ||
| Harper: Restart Language Server | `harper.languageserver.restart` | Restart `harper-ls` | | ||
|
||
### Settings | ||
|
||
| Setting | Type | Default Value | Description | | ||
| ------------------------------ | ------------------------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `harper-ls.path` | `string` | `""` | Optional path to a `harper-ls` executable to use. Primarily useful if the bundled binary doesn't work in your system like in immutable Linux distributions. | | ||
| `harper-ls.linters.*` | `boolean` | Varies | Detect and provide suggestions in a variety of common situations. | | ||
| `harper-ls.diagnosticSeverity` | `"error"`, `"hint"`, `"information"`, `"warning"` | `"information"` | How severe do you want diagnostics to appear in the editor? | | ||
|
||
## Developing and Contributing | ||
|
||
See the [Development Guide](/packages/vscode-plugin/development-guide.md). | ||
You can learn more about [this extension](https://writewithharper.com/docs/integrations/visual-studio-code) and [Harper](https://writewithharper.com/docs/about) over at our [official website](https://writewithharper.com). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,3 @@ | ||
# Development Guide | ||
|
||
This document details how to develop the extension locally. If you're interested in how it's packaged for distribution, you can checkout the [Package VS Code Plugin](/.github/workflows/package_vscode_plugin.yml) workflow. | ||
|
||
## Notes | ||
|
||
- The extension code and its tests live in the `src` directory. Most changes you'll need to make will be there. | ||
- VS Code can only pickup 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. | ||
- You can look at the project's [`justfile`](/justfile) to see exactly what running the `just` recipes below do. | ||
|
||
## Prerequisites | ||
|
||
- Make sure to read the [Contributing guide](/CONTRIBUTING.md) and follow the "Setup Your Environment" section. | ||
- 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 | ||
|
||
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 | ||
|
||
```console | ||
just test-vscode | ||
``` | ||
|
||
## Packaging and Installing the Extension | ||
|
||
1. Package the extension: | ||
|
||
```console | ||
just package-vscode | ||
``` | ||
|
||
2. Install the extension: | ||
|
||
```console | ||
code --install-extension path/to/created/.vsix | ||
``` | ||
This document has been moved to the [official documentation](https://writewithharper.com/docs/contributors/visual-studio-code). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/web/src/routes/docs/contributors/visual-studio-code/+page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: 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 checkout the [Release VS Code Plugin](https://github.com/Automattic/harper/blob/master/.github/workflows/release_vscode_plugin.yml) 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 pickup 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. | ||
- 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 do. | ||
|
||
## Prerequisites | ||
|
||
- Make sure to [set up your environment](./environment). | ||
- 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 | ||
|
||
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 | ||
|
||
```bash | ||
just test-vscode | ||
``` | ||
|
||
## Packaging and Installing the Extension | ||
|
||
1. Package the extension: | ||
|
||
```bash | ||
just package-vscode | ||
``` | ||
|
||
2. Install the extension: | ||
|
||
```bash | ||
code --install-extension path/to/created/.vsix | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,77 @@ | ||
--- | ||
title: Helix Support | ||
title: Helix | ||
--- | ||
|
||
To use Harper in [Helix](https://helix-editor.com/), you'll need to have `harper-ls` installed. | ||
Our Helix integration is powered by [`harper-ls`](./language-server). | ||
|
||
Once you do, add this to you configuration: | ||
## Required Setup | ||
|
||
```toml | ||
Make sure you have [`harper-ls` installed](./language-server#Installation) on your system and available in your `PATH`. | ||
|
||
Helix supports language servers [out-of-the-box](https://docs.helix-editor.com/languages.html), but you'll still need to configure it to use `harper-ls`. First, you need to tell Helix how it should run `harper-ls`: | ||
|
||
```toml title=languages.toml | ||
[language-server.harper-ls] | ||
command = "harper-ls" | ||
args = ["--stdio"] | ||
``` | ||
|
||
Helix has [official documentation](https://github.com/helix-editor/helix/wiki/Language-Server-Configurations#harper-ls) as well. | ||
Then, for all the [languages `harper-ls` supports](./language-server#Supported-Languages) that you want it to be enabled for, you need to declare the following in your `languages.toml`: | ||
|
||
```toml title=languages.toml | ||
[[language]] | ||
name = "language-id" | ||
language-servers = ["default-servers", "harper-ls"] | ||
``` | ||
|
||
where `language-id` is the language ID of the language you want `harper-ls` to be used for and `default-servers` are any of the [default language servers](https://docs.helix-editor.com/lang-support.html) supported by Helix that you use for that language. For example, if you want to configure it for Markdown and you use both Marksman and Markdown-Oxide, you'd end up with this: | ||
|
||
```toml title=languages.toml | ||
[[language]] | ||
name = "markdown" | ||
language-servers = ["marksman", "markdown-oxide", "harper-ls"] | ||
``` | ||
|
||
You need to include the default language servers since there currently isn't a way to append a language server to the default `language-servers` list. Of course, you can also add other language servers you use before or after `harper-ls`. | ||
|
||
## Optional Configuration | ||
|
||
Additionally, you can also configure things like which linters to use or how you want code actions to appear. Below is an example config where everything is set to their default values: | ||
|
||
```toml title=languages.toml | ||
[language-server.harper-ls.config.harper-ls] | ||
userDictPath = "" | ||
fileDictPath = "" | ||
diagnosticSeverity = "hint" | ||
isolateEnglish = false | ||
|
||
[language-server.harper-ls.config.harper-ls.linters] | ||
SpellCheck = true | ||
SpelledNumbers = false | ||
AnA = true | ||
SentenceCapitalization = true | ||
UnclosedQuotes = true | ||
WrongQuotes = false | ||
LongSentences = true | ||
RepeatedWords = true | ||
Spaces = true | ||
Matcher = true | ||
CorrectNumberSuffix = true | ||
|
||
[language-server.harper-ls.config.harper-ls.codeActions] | ||
ForceStable = false | ||
|
||
[language-server.harper-ls.config.harper-ls.markdown] | ||
IgnoreLinkTitle = false | ||
``` | ||
|
||
:::note | ||
This example only contains some of the available linters, check out our [rules page](../rules) to view the full list. | ||
::: | ||
|
||
For more information on what each of these configs do, you can head over to the [configuration section](./language-server#Configuration) of our `harper-ls` documentation. | ||
|
||
## Additional Links | ||
|
||
- [Helix's official documentation on `harper-ls`](https://github.com/helix-editor/helix/wiki/Language-Server-Configurations#harper-ls) | ||
- [Community discussion on configuring `harper-ls` for Helix](https://github.com/Automattic/harper/discussions/135) |
Oops, something went wrong.