Skip to content

Commit ec55c63

Browse files
committed
docs: improve readme
Signed-off-by: Kevin Cui <bh@bugs.cc>
1 parent 8b6eb43 commit ec55c63

File tree

1 file changed

+108
-27
lines changed

1 file changed

+108
-27
lines changed

README.md

Lines changed: 108 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,126 @@
11
# idea-spell-check
22

3-
![Build](https://github.com/BlackHole1/idea-spell-check/workflows/Build/badge.svg)
4-
[![Version](https://img.shields.io/jetbrains/plugin/v/20676-cspell-check.svg)](https://plugins.jetbrains.com/plugin/20676-cspell-check)
5-
[![Downloads](https://img.shields.io/jetbrains/plugin/d/20676-cspell-check.svg)](https://plugins.jetbrains.com/plugin/20676-cspell-check)
3+
![Build](https://github.com/BlackHole1/idea-spell-check/workflows/Build/badge.svg) [![Version](https://img.shields.io/jetbrains/plugin/v/20676-cspell-check.svg)](https://plugins.jetbrains.com/plugin/20676-cspell-check) [![Downloads](https://img.shields.io/jetbrains/plugin/d/20676-cspell-check.svg)](https://plugins.jetbrains.com/plugin/20676-cspell-check)
64

75
<!-- Plugin description -->
86

9-
To parse the CSpell configuration file and automatically add words to the IDEA dictionary to prevent warnings.
10-
11-
Support configuration file:
12-
- .cspell.json
13-
- .cSpell.json
14-
- cspell.json
15-
- cSpell.json
16-
- cspell.config.js
17-
- cspell.config.cjs
18-
- cspell.config.json
19-
- cspell.config.yaml
20-
- cspell.config.yml
21-
- cspell.yaml
22-
- cspell.yml
23-
- package.json `cspell` field
7+
Automatically parses project-level CSpell configuration files inside JetBrains IDEs and synchronizes custom vocabularies with the IDE runtime dictionary, keeping spell checking noise-free for the whole team.
248

259
<!-- Plugin description end -->
2610

2711
![example](https://raw.githubusercontent.com/BlackHole1/idea-spell-check/main/assets/example.gif)
2812

13+
## Overview
14+
15+
`idea-spell-check` targets JetBrains IDEs such as IntelliJ IDEA, WebStorm, and PyCharm etc. It watches CSpell configuration files as well as external dictionaries, merges them, and refreshes the IDE dictionary automatically so shared spelling rules are always respected.
16+
17+
## Key Features
18+
19+
- **Priority-aware discovery**: Mirrors the official CSpell file naming hierarchy and always picks the highest-priority configuration available in project roots, `.config`, `.vscode`, and related directories.
20+
- **Real-time file watching**: Uses Virtual File System listeners with debounce control, so any saved change triggers a re-parse and refresh with minimal overhead.
21+
- **Dictionary aggregation**: Reads `dictionaryDefinitions` together with `dictionaries`, fetching extra word lists from referenced files and merging them into the IDE dictionary.
22+
- **Node.js auto-detection**: For `.js/.cjs/.mjs` configs the plugin locates a Node.js runtime automatically or lets you provide a custom executable path in settings.
23+
- **Multi-root coverage**: Add extra search folders via the settings page to support monorepos and multi-module repositories.
24+
2925
## Installation
3026

31-
- Using IDE built-in plugin system:
32-
33-
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "Cspell Check"</kbd> >
34-
<kbd>Install Plugin</kbd>
35-
36-
- Manually:
27+
### JetBrains Marketplace
28+
29+
1. Open `Settings/Preferences`.
30+
2. Navigate to `Plugins``Marketplace` and search for **“CSpell Check”**.
31+
3. Click `Install`, then restart the IDE.
32+
33+
### Manual Installation
34+
35+
1. Download the [latest release](https://github.com/BlackHole1/idea-spell-check/releases/latest).
36+
2. In `Settings/Preferences``Plugins`, click the gear icon.
37+
3. Choose `Install Plugin from Disk...`, select the downloaded archive, and restart the IDE.
38+
39+
## Usage Guide
40+
41+
### Configuration Discovery
42+
43+
- The plugin scans the project root and any configured custom paths, applying the priority list above to determine the effective CSpell configuration.
44+
- When a higher-priority file appears, it replaces the previously active configuration automatically.
45+
46+
### Dictionary Files
47+
48+
- A dictionary definition is loaded when either `addWords` is `true` **or** the definition name is listed inside the `dictionaries` array.
49+
- Only when `addWords` is `false` **and** the definition is never referenced by `dictionaries` will the file be ignored.
50+
- Blank lines and lines that begin with `#`, `//`, or `;` are skipped while reading external dictionary files.
51+
52+
### Node.js-backed Configurations
53+
54+
- Parsing `.js`, `.cjs`, or `.mjs` configs requires Node.js.
55+
- The plugin searches common locations (PATH, nvm, Volta, fnm, Homebrew, etc.) and exposes a manual override under `Settings/Preferences | Tools | CSpell Check`.
56+
- If no runtime is available, the plugin shows a notification and skips only the script-based configs while keeping other sources active.
57+
58+
### Supported Configuration Sources
59+
60+
- Checked in order from top to bottom to determine the active configuration.
61+
- `.cspell.json`
62+
- `cspell.json`
63+
- `.cSpell.json`
64+
- `cSpell.json`
65+
- `.cspell.jsonc`
66+
- `cspell.jsonc`
67+
- `.cspell.yaml`
68+
- `cspell.yaml`
69+
- `.cspell.yml`
70+
- `cspell.yml`
71+
- `.cspell.config.json`
72+
- `cspell.config.json`
73+
- `.cspell.config.jsonc`
74+
- `cspell.config.jsonc`
75+
- `.cspell.config.yaml`
76+
- `cspell.config.yaml`
77+
- `.cspell.config.yml`
78+
- `cspell.config.yml`
79+
- `.cspell.config.mjs`
80+
- `cspell.config.mjs`
81+
- `.cspell.config.cjs`
82+
- `cspell.config.cjs`
83+
- `.cspell.config.js`
84+
- `cspell.config.js`
85+
- `.cspell.config.toml`
86+
- `cspell.config.toml`
87+
- `.config/.cspell.json`
88+
- `.config/cspell.json`
89+
- `.config/.cSpell.json`
90+
- `.config/cSpell.json`
91+
- `.config/.cspell.jsonc`
92+
- `.config/cspell.jsonc`
93+
- `.config/cspell.yaml`
94+
- `.config/cspell.yml`
95+
- `.config/.cspell.config.json`
96+
- `.config/cspell.config.json`
97+
- `.config/.cspell.config.jsonc`
98+
- `.config/cspell.config.jsonc`
99+
- `.config/.cspell.config.yaml`
100+
- `.config/cspell.config.yaml`
101+
- `.config/.cspell.config.yml`
102+
- `.config/cspell.config.yml`
103+
- `.config/.cspell.config.mjs`
104+
- `.config/cspell.config.mjs`
105+
- `.config/.cspell.config.cjs`
106+
- `.config/cspell.config.cjs`
107+
- `.config/.cspell.config.js`
108+
- `.config/cspell.config.js`
109+
- `config/.cspell.config.toml`
110+
- `config/cspell.config.toml`
111+
- `.vscode/.cspell.json`
112+
- `.vscode/cSpell.json`
113+
- `.vscode/cspell.json`
114+
- `package.json` (`cspell` block including `dictionaryDefinitions`)
37115

38-
Download the [latest release](https://github.com/BlackHole1/idea-spell-check/releases/latest) and install it manually using
39-
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
116+
## Contributing
40117

118+
1. Clone the repository and run `./gradlew build` to compile the plugin.
119+
2. Execute `./gradlew test` to validate the parsing logic.
120+
3. Use the `Run IDE for UI Tests` task to launch a sandbox IDE with the plugin for interactive testing.
121+
4. Contributions via pull requests or issues are welcome to further improve the CSpell experience on JetBrains platforms.
41122

42123
---
43-
Plugin based on the [IntelliJ Platform Plugin Template][template].
124+
Built on top of the [IntelliJ Platform Plugin Template][template].
44125

45126
[template]: https://github.com/JetBrains/intellij-platform-plugin-template

0 commit comments

Comments
 (0)