Spellchecking
AppCode helps you make sure that all your source code, including textual strings, comments, literals, and commit messages, is spelt correctly. For this purpose, AppCode 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.
Check spelling of a word
With the Typo inspection enabled, AppCode 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
Place the caret on a word highlighted by the Typo inspection.
Click the light bulb icon or press N/A to show the available intention actions.
Choose the
action and select the desired spelling from the suggestion list.
Accept a misspelled word
Place the caret on a word highlighted by the Typo inspection.
Click the light bulb icon or press N/A to show the available intention actions.
Choose the default dictionary is selected, AppCode will allow you to choose the one to save the word to.
action to add the word to the user's dictionary and skip it in the future. If no
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
anden_GB.aff
. Thedic
file contains a list of words together with the applicable modification rules. Theaff
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 AppCode.
Choose the dictionaries to use
In the Settings/Preferences dialog (N/A), choose Spelling under Editor.
- 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 or press N/A and choose the required file in the dialog that opens 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 or press N/A. The corresponding file will open in a new editor tab.
To remove a custom dictionary from the list, select it and click or press N/A.
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
Switch to the Accepted Words tab.
- Create a Word List:
Click the 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 .
Configure the spellchecking options
Set the spellchecking defaults
In the Settings/Preferences dialog (N/A), choose Spelling under Editor.
- 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, AppCode will allow you to choose the one to save the word to on invoking the Change to... intention action on a mistyped word.
If necessary, use the spin box to specify the limit on the number of words suggested by the spellchecker.
Configure the Typo inspection
In the Settings/Preferences dialog (N/A), choose Inspections under Editor.
On the Inspections page that opens showing the list of inspection types, expand the Spelling node and click Typo in the central pane.
- 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.