Spellchecking
Configure: Settings | Editor | Natural Languages | Spelling
Inspection: Settings | Editor | Inspections | Proofreading | Typo
MPS checks the spelling of all your source code, including single-line comments, Javadoc text, and string literals.
The Typo inspection detects and highlights words that are not included in any dictionary. You can either correct the spelling or save the word to the dictionary.
If a detected typo is actually a valid word, you can add it to a user-defined dictionary that extends the built-in dictionaries.
Select the Add to dictionary action in the Context menu to add the word to the user's dictionary and skip it in the future.
tip
Press F2 and ShiftF2 to step through all problems in a file, including typos.
Spellchecking is enabled for all languages. To indicate that the text of a particular editor cell should be checked against a dictionary (as configured in Settings), add the ’spellcheck’ style attribute in the Inspector to the cell in your editor declaration.
tip
When building a standalone IDE (Rich Client Platforms aka. RCP), don’t forget to include the ’jetbrains.mps.editor.spellcheck’ plugin in a distribution.
MPS includes bundled dictionaries for all configured languages. You cannot change them directly, but you can extend the spellchecker in other ways:
Save words to a built-in global or project dictionary.
Add plain-text files with the .dic extension that contain lists of words.
You can add Hunspell dictionaries, each of which consists of two files: the DIC file that contains a list of words with the applicable modification rules and the AFF file that lists prefixes and suffixes regulated by a specific modification rule. For example, en_GB.dic and en_GB.aff.
Press CtrlAlt0S to open the IDE settings and then select Editor | Natural Languages | Spelling.
Configure the list of custom dictionaries:
To add a new custom dictionary to the list, click
or press AltInsert and specify the location of the required file.
To edit the contents of a custom dictionary in MPS, select it and click
or press Enter. The corresponding file will open in a new editor tab.
To remove a custom dictionary from the list, select it and click
or press AltDelete.
Press CtrlAlt0S to open the IDE settings and then select Editor | Natural Languages | Spelling.
Select either the built-in project-level or application-level dictionary or disable the option to prompt you every time you save a word.
Press CtrlAlt0S to open the IDE settings and then select Editor | Natural Languages | Spelling.
Add words to the Accepted words list. MPS adds manually accepted words to the project-level dictionary.
You can't add words that are already present in one of the dictionaries and mixed-case words, such as
CamelCase
andsnake_case
.
tip
The Accepted words list also contains words that you saved to either the built-in global or project dictionary. Although it does not contain words added to the project-level dictionary by other users and words from other custom dictionaries, the Typo inspection will not highlight them.
MPS stores the built-in project-level dictionary with other project-related files. This means that anyone working with the project has access to the words stored in this dictionary.
Thanks for your feedback!