How to use LanguageTool on VS Code
I pay for LanguageTool to check my spelling and grammar. Until now, I've been using a Proton document to write my blog posts so that LanguageTool can check my text. But, I wanted to do everything in one place: VS Code.
LanguageTool Linter Extension #
LanguageTool Linter is a VS Code extension to allow spell and grammar check within VS Code.
How to set up LanguageTool Linter with a Premium Account #
With the premium account, more checks are done to text. It was not very obvious to me at first, but we can use the feature within the VS Code.
Note: When I was searching for the LanguageTool API, I saw info about the Proofreading API, which costs €29~/month. This is not what we need, and a Premium account is enough for enabling the premium features.
Step 1: Install the LanguageTool Linter extension #
Install the LanguageTool Linter on VS Code. And go to the extension's setting (@ext:davidlday.languagetool-linter
).
Step 2: Set API Access Token & External URL #
To use with a premium account, I needed to first generate an API key from my account. To do so, go to the Access Tokens page under Settings. Then generate a token.
After generating a token, you will see Username and API Key
- External URL:
https://api.languagetoolplus.com/
- External Username (
languageToolLinter.external.username
): Set to the username from the Access Tokens page - External API Key (
languageToolLinter.external.apiKey
): Set to the API Key you got from the Access Tokens page
Step 3: Check the Service Type is set to "External" #
Since I'm using the server specific to the premium account (api.languagetoolplus.com
), I need to tell the Linter extension that I'm using an external service in the Service Type setting. By default, it's set to "external", so you may not need to change this.
Step 4 (optional): Configure Diagnostic Settings #
The LanguageTool Linter extension can flag spelling mistakes as Error, and punctuation, grammar, and typography mistakes as Warning. I wanted this option, so I enabled it under "Diagnostic Severity Auto" (languageToolLinter.diagnosticSeverityAuto
).
It's recommended to set the Diagnostic Severity level (languageToolLinter.diagnosticSeverity
) as "information" when using the "Diagnostic Severity Auto" option. So I set it as so.
Resulting config #
In summary, I added the following configuration to settings.json
:
"languageToolLinter.diagnosticSeverity": "information",
"languageToolLinter.external.apiKey": YOUR_API_KEY,
"languageToolLinter.external.username": YOUR_API_USERNAME,
"languageToolLinter.external.url": "https://api.languagetoolplus.com/",
"languageToolLinter.diagnosticSeverityAuto": true
Happy LanguageTool Linting on VS Code #
Now I got my language checker on my VS Code, I can write more blog posts and share more—or at least that's what I hope to do.
- Previous: Self-hosting Bluesky PDS at Home