AppCode 2017.3 Help


On this page:


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

Correctness of spelling is checked against pre-defined dictionaries (as of now, jetbrains.dic and english.dic), and any number of user-defined custom dictionaries.

A user dictionary is a textual file with the dic extension, containing the words you want to be accepted by the Typo inspection as correct. The words in such dictionaries are delimited with the newline.

Besides that, you can define your own list of words that will be skipped by the inspection. You can add words to this list "on-the-fly", or intentionally while setting up your spellchecker options.

With the Typo inspection enabled, AppCode detects and highlights words not included in dictionaries and user's words list. It up to the user to provide correct spelling, accept word as is, or disable inspection.

If a word is accepted, it will be added to the user's words list, and skipped by the spellchecker in future. If inspection is disabled, all typos will be ignored.

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

Checking the spelling of a word

  1. Place the caret on a word highlighted by the Typo inspection.
  2. Press ⌥⏎ to show the available intention actions.
  3. Choose one of the following actions:
    • Change to: select the desired spelling of a textual string or comment from the suggestion list.
    • Save to dictionary: add word to the user's list and skip it in future.

Configuring the dictionaries to use

  1. Open the AppCode Preferences by choosing AppCode | Preferences, and click Spelling under Editor.
  2. Define the set of dictionaries to be used for spellchecking.
    1. Switch to the Dictionaries tab.
    2. The Dictionaries area in the bottom of the page shows a list of the dictionaries that can be used in spellchecking. The list contains the dictionaries that come bundled with AppCode by default and user-defined dictionaries detected in the folders from the Custom Dictionaries Folder area above.

      • To have a default dictionary applied in the current project, select the check box next to it.
      • To exclude a default dictionary from spellchecking within the scope of the current project, clear the check box next to it.
    3. In the Custom Dictionaries Folder area, configure your custom dictionaries to use. This area displays a list of directories that contain user-defined dictionary files (text files with the dic extension, containing words separated with a newline).
      • To add a new folder to the list, click add and choose the required folder in the dialog that opens dialog that opens.

        The full path to the folder is added to the Custom Dictionaries Folder list, and all the *.dic files found in this folder are added to the Dictionaries list.

      • To remove a folder from the list, select it and click delete.
  3. Besides configuring a custom dictionary, you can create your own Word List with the words that you want to be skipped during spell checking without being included in a custom dictionary.
    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, AppCode 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.

Configuring spellchecking options

  1. Open the AppCode Preferences by choosing AppCode | Preferences, and click Inspections under Editor.
  2. On the Inspections page, that opens showing a 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.

Changing the language

The spellchecking feature doesn't allow you to change the language per se, but allows you to add your own dictionaries to a directory. This is how it's done.

To add a dictionary, follow these steps:

  1. Create a directory in your file system, and in it a text file with the .dic extension.
  2. Under the node Editor of the Settings/Preferences dialog, click Spelling.
  3. In the Dictionaries tab, click add in the section Custom Dictionaries Folder.
  4. In the Select Path dialog that opens, point to the directory you've created.

Thus AppCode will not report a typo for a word in the language you've created a dictionary for.

Last modified: 27 March 2018

See Also