- JavaScript 83.2%
- Shell 6.6%
- Dockerfile 5.6%
- Less 4.6%
| keymaps | ||
| languagetool | ||
| lib | ||
| lz-specs | ||
| spec | ||
| styles | ||
| docker-compose.yml | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
pulsar-languagetool
A Pulsar Edit package that checks the file open in the editor against a local LanguageTool server running in Docker.
- Grammar errors are underlined in purple.
- Hovering an underline shows the message returned by LanguageTool.
- Right-clicking an underline offers replacement suggestions plus a dismiss option; clicking a suggestion applies it to the buffer.
Repository layout
docker-compose.yml # runs the LanguageTool server (port 8081)
languagetool/
Dockerfile # pinned LanguageTool 6.6 on a slim JRE image
start.sh # downloads ngram data on first start, then launches
package.json # the Pulsar package manifest
lib/ # package source (main, HTTP client, popup helper)
keymaps/ # default keybindings (configurable)
styles/ # purple underline + popup styles
spec/ # unit specs + live-server integration specs
1. Start the LanguageTool server
docker compose up -d
On first start the container downloads the English ngram dataset
(ngrams-en-20150817.zip,
~8.9 GB) into the ngram-data volume. This happens only once; later starts
reuse the volume. You can watch progress with docker compose logs -f.
If you'd rather skip the ngram data (the server works fine without it, it just misses the ngram-based rules):
SKIP_NGRAM_DOWNLOAD=true docker compose up -d
Verify the server is up:
curl -d "language=en-US" -d "text=this are a test" http://localhost:8081/v2/check
2. Point Pulsar at the development version of the plugin
The package is not published to a repository yet, so link it from your local clone (from the root of this repository):
pulsar -p link
This symlinks the repo into ~/.pulsar/packages/pulsar-languagetool. Reload
Pulsar (or restart it) and the package will be active — check
Settings → Packages to confirm.
To unlink later: pulsar -p unlink.
3. Usage
- Press Ctrl+Alt+L in any editor to check the
current file (Ctrl+Alt+Shift+L
clears the underlines). The same commands are available from the command
palette as
pulsar-languagetool:checkandpulsar-languagetool:clear. - Purple underlines mark the problems found.
- Hover an underline to see LanguageTool's message.
- Right-click an underline to pick one of the suggested fixes or dismiss it.
Configuring the hotkey
Keybindings are fully configurable through Pulsar. Edit
Edit → Keymap… (~/.pulsar/keymap.cson) and bind the commands to whatever
you like — your binding overrides the package default:
'atom-text-editor':
'ctrl-shift-g': 'pulsar-languagetool:check'
Package settings
Settings → Packages → pulsar-languagetool:
| Setting | Default | Description |
|---|---|---|
serverUrl |
http://localhost:8081 |
Base URL of the LanguageTool server. |
language |
en-US |
Language code (en-US, en-GB, de-DE, …) or auto for server-side detection. |
maxSuggestions |
5 |
Max suggestions shown in the right-click menu. |
4. Development
Run the spec suite:
pulsar --test spec/
spec/pulsar-languagetool-spec.js is self-contained (mocked HTTP).
spec/integration-spec.js runs against a live server at http://localhost:8081
(override with LANGUAGETOOL_URL); when no server is reachable those specs
pass without testing anything.