DataGrip 2020.3 Help

Spellchecking

DataGrip helps you make sure that all your source code, including variable names, textual strings, comments, literals, and commit messages, is spelt correctly. For this purpose, DataGrip provides a dedicated Typo inspection which is enabled by default.

Typo quick fix

In textual strings and comments, only the spelling of this particular word at caret changes. Where the Rename refactoring is available, the inspection suggests to rename all occurrences of a symbol .

The Typo inspection detects and highlights words not included in any dictionary. You can either correct the spelling or accept the word as correct. Disable the Typo inspection if you want to ignore all spelling mistakes. For more information, see Configure the Typo inspection.

Correct a misspelled word

  1. Place the caret at a word highlighted by the Typo inspection.

  2. Click the Intention action button or press Alt+Enter to show the available intention actions.

  3. Select one of the suggested fixes from the list.

To jump to the next misspelled word, press F2.

Accept a misspelled word

  1. Place the caret at a word highlighted by the Typo inspection.

  2. Click Intention action icon or press Alt+Enter to show the available intention actions.

  3. Select the Save to dictionary action to add the word to the user's dictionary and skip it in the future.

    To remove the word that you just added, press Ctrl+Z.

By default, DataGrip saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project. For more information, see Select the default dictionary for saving words.

Configure the Typo inspection

Define the scope and severity of the inspection.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor | Inspections.

  2. Expand the Proofreading node and click Typo in the central pane.

  3. In the right-hand pane, configure the Typo inspection:

    • In the Options area, define the type of contents to be inspected by selecting or clearing the Process code, Process literals, and Process comments checkboxes.

    • In the Severity area, choose the inspection severity level and the scope in which to apply this level.

      Select Warning or Error from the Severity list to highlight all text typos in the editor scrollbar similar to errors or warnings in your code.

Dictionaries

DataGrip includes bundled dictionaries for all configured languages. You cannot modify 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.

  • If you have the Hunspell plugin installed and enabled, you can add Hunspell dictionaries, which comprise 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.

Configure the spellchecker dictionaries

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor | Proofreading | Spelling.

  2. Configure the list of custom dictionaries:

    • To add a new custom dictionary to the list, click the Add button or press Alt+Insert and specify the location of the required file.

    • To edit the contents of a custom dictionary in DataGrip, select it and click the Edit button 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 the Remove button or press Alt+Delete.

Select the default dictionary for saving words

By default, DataGrip saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor | Proofreading | Spelling.

  2. Select either the built-in project-level or application-level dictionary or disable the option to prompt you every time you save a word.

Add accepted words manually

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor | Proofreading | Spelling.

  2. Add words to the Accepted words list.

    You can't add words that are already present in one of the dictionaries and mixed-case words, such as CamelCase and snake_case.

    These words are added to the project-level dictionary.

Last modified: 16 October 2020