Grammar, Style and Spell Checking in VS Code via LanguageTool. Support Markdown, MDX, HTML, and plain text files.
In memory of Adam Voss, original creator of the LanguageTool for Visual Studio Code extension.
- Issue highlighting with hover description.
- Replacement suggestions.
- Checks plain text, Markdown, MDX, and HTML.
- Smart format on type to replace quotes with smart quotes, multiple consecutive
hyphens with em or en-dash, and three consecutive periods with ellipses.
- Make sure 'Editor: Format On Type' is enabled or this feature won't work.
You can enable it at the document format level as well in your
settings.json
.
- Make sure 'Editor: Format On Type' is enabled or this feature won't work.
You can enable it at the document format level as well in your
- Allow specific rules to be ignored for markdown (pandoc) and HTML
The defaults are probably not going to work for you, but they are there to make sure using LanguageTool's Public API is done by choice. See this issue on the Atom LanguageTool Linter for an explanation why.
The defaults assume the following:
-
You do not want to use the LanguageTool's Public API
-
You're running LanguageTool HTTP Server on your machine using the default port of 8081.
- You can run a local LanguageTool server using the
unofficial Docker image
with
docker run --rm -p 8081:8010 silviof/docker-languagetool
. See silvio/docker-languagetool for more information.
- You can run a local LanguageTool server using the
unofficial Docker image
with
-
You do not want to have this extension manage your local LanguageTool HTTP Server service.
If this doesn't work for you, here are your options.
This could either be a locally running instance of LanguageTool, or the service running somewhere else.
- Set the URL in “LanguageTool Linter > External: URL” (i.e.
http://localhost:8081
). - Set “LanguageTool Linter: Service Type” to
external
.
Works well if you're only using LanguageTool in Visual Studio Code.
- Install LanguageTool locally.
- Set “LanguageTool Linter > Managed: Class Path” to the location of the
languagetool-server.jar
file. The install doc has hints. - Set “LanguageTool Linter: Service Type” to
managed
.
Make sure you read and understand LanguageTool's Public API before doing this.
- Set “LanguageTool Linter: Service Type” to
public
.
Most configuration items should be safe, but there are three you should pay particular attention to:
- Public Api: This will use LanguageTool's Public API service. If you violate their conditions, they'll block your IP address.
- Lint on Change: This will make a call to the LanguageTool API on every change. If you mix this with the Public Api, you're more likely to violate their conditions and get your IP address blocked.
- LanguageTool: Preferred Variants: If you set this, then LanguageTool:
Language must be set to
auto
. If it isn't, the service will throw an error.
You have the chance to ignore specific rules inline to not bloat up your ignore list for single words:
<!-- @IGNORE:UPPERCASE_SENTENCE_START@ -->
soll heißen, dass die Nachricht von mir ist, die Koordinaten hat
ein kleiner Computer, den Sigrún mir zur Verfügung gestellt hat aus
dem irdischen
‚World Geodetic System 1984‘ <!-- @IGNORE:GERMAN_SPELLER_RULE(Geodetic)@ -->
This example will ignore the missing capital letter at the beginning (soll → Soll) and an unknown word ('Geodetic')
The optional match word is useful if the same rule is applied to several words in the sentence.
The rules can be applied to the current line (e.g. at the end) or at the line before.
Syntax:
@LT-IGNORE:<rulename>(<text-match>)@
The and the text-match
is optional.
Note: Even in pandoc you have to handle the comment in html output. This can be done by using a filter.
The following projects provided excellent guidance on creating this project.