Skip to content

Commit dc3736d

Browse files
Switch to using LSP (#41)
* Draft * Draft * Draft * Update dependencies * Update LSP version * Create pre-release version * Update dependencies * Improve draft * Updates * Add initialization options * Update LS version * Add filters to replicate spell check and min alert level features * Remove old files * Add nvmrc * Ignore binaries * Update dependencies * Remove binary copy * Update dependencies * Add code to download, extract, and setup Vale LS * Update VSCode engine * Fix sync issues Signed-off-by: Chris Chinchilla <[email protected]> * Add Windows version * Final prep * Switch to even numbering for releases * Update build action --------- Signed-off-by: Chris Chinchilla <[email protected]>
1 parent 753eb21 commit dc3736d

File tree

13 files changed

+2882
-1952
lines changed

13 files changed

+2882
-1952
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '16'
17+
node-version: '18'
1818
cache: 'npm'
1919
- name: Install global dependencies
2020
run: npm install -g typescript vsce

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6+
vale-ls
7+
vale_bin
8+
.DS_Store

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.11.0

README.md

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
# Vale + VS Code
22

33
[![Publish Extension on tag](https://github.com/ChrisChinchilla/vale-vscode/actions/workflows/publishTags.yml/badge.svg)](https://github.com/ChrisChinchilla/vale-vscode/actions/workflows/publishTags.yml)
4-
[![Sponsor Chris Chinchilla](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/chrischinchilla)
4+
5+
> The Visual Studio Code extension for [Vale](https://github.com/errata-ai/vale).
56
67
The Vale extension for VS Code provides customizable spelling, style, and grammar checking for a variety of markup formats (Markdown, AsciiDoc, reStructuredText, HTML, and DITA).
78

9+
## Important notes on switch to Vale Language Server as of v0.30.0
10+
11+
There are issues I know about with this switch. But I have been sitting on this for so long I wanted to release it and will fix soon™️.
12+
13+
**If the extension is unable while I fix those features, then the old pre-LSP version is still available as the pre-release version (v0.21.0) of the extension.**
14+
15+
> [!NOTE]
16+
> This new release uses the [Vale Language Server](https://github.com/errata-ai/vale-ls). This allows for tighter integration with Vale features, but does involve more platform specific work and some features of the old extension are harder to implement.
17+
> I based re-development of these features [on this survey](https://github.com/ChrisChinchilla/vale-vscode/discussions/50). If you find features you use no longer working, [open an issue](https://github.com/ChrisChinchilla/vale-vscode/issues/new).
18+
19+
> [!WARNING]
20+
> I know that for those of you use you workspaces, the extension has been broken for a little while. Sorry! I am working on this.
21+
> The Vale Language Server also has no support for custom Vale binary paths. Again, I am attempting to find a solution to this.
22+
823
## Installation
924

1025
1. Install [Vale](https://vale.sh/docs/vale-cli/installation/);
1126
2. install `vale-vscode` (this extension) via the [Marketplace](https://marketplace.visualstudio.com/items?itemName=chrischinchilla.vale-vscode);
1227
3. Restart VS Code (recommended).
1328

14-
### Install pre-release
15-
16-
_Want to test the pre-release version? Use the "Switch to Pre-Release Version" button on extension page in VSCode._
17-
18-
The current pre-release version is `0.21.0` and switches to using the [Vale language server protocol (LSP)](https://github.com/errata-ai/vale-ls). Only basic problem highlighting works, but your help is appreciated in testing and providing feedback.
19-
2029
## Features
2130

2231
At the moment, the extension uses any [configuration](https://vale.sh/docs/topics/config/), [vocabularies](https://vale.sh/docs/topics/vocab/), and [packages](https://vale.sh/docs/topics/packages/) defined in your Vale configuration. If you experience any issues with the extension, check if Vale runs as expected on the command line first.
@@ -45,8 +54,6 @@ Fix word usage, capitalization, and more using [Quick Fixes](https://code.visual
4554

4655
### Spell checking
4756

48-
> As of version 0.17.0, the extension supports spell-checking. The feature is new and likely to change, you can disable it from the settings if you use other spell checkers or experience performance issues.
49-
5057
**You need a [`spelling` style](https://vale.sh/docs/topics/styles/#spelling) in your Vale configuration to enable spell-checking**.
5158

5259
With no additional Vale configuration, the spell checker uses a Hunspell-compatible US English dictionary. If you want to use other custom dictionaries, then configure your [`spelling` style](https://vale.sh/docs/topics/styles/#spelling) with custom dictionaries.
@@ -57,38 +64,10 @@ The extension doesn't support adding words to dictionaries. For now, the best op
5764

5865
The extension offers a number of settings and configuration options (_Preferences > Extensions > Vale_).
5966

60-
- `vale.valeCLI.config` (default: `null`): Absolute path to a Vale configuration file. Use the predefined [`${workspaceFolder}`](https://code.visualstudio.com/docs/editor/variables-reference#_predefined-variables) variable to reference configuration file from a custom location. (**NOTE**: On Windows you can use '/' and can omit `.cmd` in the path value.) If not specified, the extension uses the default search process (relative to the current file).
61-
62-
**Example**
63-
64-
```jsonc
65-
{
66-
// You can use ${workspaceFolder} it will be replaced by workspace folder path
67-
"vale.valeCLI.config": "${workspaceFolder}/node_modules/some-package/.vale.ini"
68-
69-
// or use some absolute path
70-
"vale.valeCLI.config": "/some/path/to/.vale.ini"
71-
}
72-
```
73-
74-
- `vale.valeCLI.path` (default: `null`): Absolute path to the Vale binary. Use the predefined [`${workspaceFolder}`](https://code.visualstudio.com/docs/editor/variables-reference#_predefined-variables) variable to reference a non-global binary. (**NOTE**: On Windows you can use '/' and can omit `.cmd` in the path value.)
75-
76-
**Example**
77-
78-
```jsonc
79-
{
80-
// You can use ${workspaceFolder} it will be replaced by workspace folder path
81-
"vale.valeCLI.path": "${workspaceFolder}/node_modules/.bin/vale"
82-
83-
// or use some absolute path
84-
"vale.valeCLI.path": "/some/path/to/vale"
85-
}
86-
```
87-
67+
- `vale.valeCLI.config` (default: `null`): Absolute path to a Vale configuration file.
8868
- `vale.valeCLI.minAlertLevel` (default: `inherited`): Defines from which level of errors and above to display in the problems view.
89-
9069
- `vale.doNotShowWarningForFileToBeSavedBeforeLinting` (default: `false`): Toggle display of warning dialog that you must save a file before Vale lints it.
91-
9270
- `vale.readabilityProblemLocation` (default: `status`): If you have any `Readability` or `metric` styles, the extension can display the readability score in the status bar, the problems view, or both.
93-
9471
- `vale.enableSpellcheck` (default: `false`): Enable in-built spell checking for any `Spelling` styles.
72+
- `vale.valeCLI.syncOnStartup` (default: `false`): If you have packages in a _.vale.ini_ file, then sync them on startup.
73+
- `vale.valeCLI.filter` (default: `null`): Add additional [Vale filters](https://vale.sh/docs/filters).

0 commit comments

Comments
 (0)