RubyMine 2018.1 Help

Spellchecking

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

In the textual strings and comments, spelling of a word at caret can be changed to a correct one. In the contexts that enable the Rename refactoring, the inspection suggests to rename all occurrences of a symbol.

Note that Ruby SpellChecker plugin is required to run the Typo inspection.

Check spelling of a word

With the Typo inspection enabled, RubyMine detects and highlights words not included in any dictionary. You can either provide the correct spelling or accept the word as is. If a word is accepted, it will be added to the custom dictionary of your choice, and skipped by the spellchecker in the future. If the Typo inspection is disabled, all typos will be ignored.

Correct a misspelled word

  1. Place the caret on a word highlighted by the Typo inspection.
  2. Click the light bulb icon intentionBulb or press Alt+Enter to show the available intention actions.
  3. Choose the Change to action and select the desired spelling from the suggestion list.

Accept a misspelled word

  1. Place the caret on a word highlighted by the Typo inspection.
  2. Click the light bulb icon intentionBulb or press Alt+Enter to show the available intention actions.
  3. Choose the Save to dictionary action to add the word to the user's dictionary and skip it in the future. If no default dictionary is selected, RubyMine will allow you to choose the one to save the word to.

Configure the dictionaries to use

Correctness of spelling is checked against the bundled dictionaries and user-defined custom dictionaries, which can be any of the following:

  • The built-in project-level and application-level dictionaries, which you populate by manually saving words to them.
  • Plain text files with the dic extension, containing words separated with a newline.
  • Hunspell dictionaries, comprised of two plain text files commonly sharing the same name, for example, en_GB.dic and en_GB.aff. The dic file contains a list of words together with the applicable modification rules. The aff file list prefixes and suffixes regulated by a specific modification rule. Hunspell dictionaries can be easily obtained online, for example, here.

Since the spellchecking feature doesn't allow you to change the language per se, adding custom dictionaries will allow you to bring virtually any language support to RubyMine.

Choose the dictionaries to use

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), choose Spelling under Editor.
  2. On the Spelling page that opens, switch to the Dictionaries tab.

    In the Custom Dictionaries area, configure your custom dictionaries to use.

    • To add a new custom dictionary to the list, click add or press Alt+Insert and choose the required file in the Select Path Dialog dialog that opens. The full path to the selected file is added to the Custom Dictionaries list.
    • To edit the contents of a custom dictionary, select it and click icon edit pencil bw 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 delete or press Alt+Delete.
  3. In the Bundled Dictionaries area, configure the bundled dictionaries to use by selecting or clearing the checkboxes next to them.

Populate the built-in dictionaries

You can manually populate the built-in project-level and application-level dictionaries with the words that you want to be skipped during spell checking.

Add an accepted word

  1. Switch to the Accepted Words tab.
  2. Create a Word List:
    • Click the new icon to open the Add New Word dialog box and specify a new entry there. CamelCase or snake_case are not supported. If you try to add a word that is already included in one of the spelling dictionaries, RubyMine displays an error message The word <just typed word> is already in the dictionary.
    • To remove an item from the list, select it and click delete.

Configure the spellchecking options

Set the spellchecking defaults

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), choose Spelling under Editor.
  2. On the Spelling page that opens, switch to the Dictionaries tab. In the Advanced settings area, choose whether you want a built-in project-level or application-level dictionary to be used as a single dictionary for saving words.

    If no default dictionary is selected, RubyMine will allow you to choose the one to save the word to on invoking the Change to... intention action on a mistyped word.

  3. If necessary, use the spin box to specify the limit on the number of words suggested by the spellchecker.

Configure the Typo inspection

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), choose Inspections under Editor.
  2. On the Inspections page that opens showing the list of inspection types, expand the Spelling 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 to apply this level in.
Last modified: 30 May 2018

See Also