Use spell-check in code comments

Tom de Geus picture Tom de Geus · Jan 1, 2015 · Viewed 9k times · Source

I'm really loving Github's Atom editor! However, there is one thing on which I get stuck.

I am sometimes struggeling to get code-comments without spelling mistakes. Therefore I like my editor to run a spell-check on the comments (e.g. such as Geany does). However I haven't got this working in Atom.

Let's use Python code as example. I've tried to enable the spell-check by adding:

text.python, text.py

to the "Grammars" field of the spell-check package. However no spell-check appears to be running for Python code. Also google was not helpfull...

Answer

Nikita picture Nikita · Mar 5, 2015

For example, to enable spell check in PHP files, go to installed packages and search "PHP". You'll see language-php core package, open it and look for the line "Scope: text.html.php." That's what you need to insert in spell-check settings. Do the same for any other type of file where you need spelling to be checked.

It's frustrating that such simple option need so many clicks to be turned on. It really should be just as simple as it is in Sublime Text.

EDIT:

Deleted the broken link, even though it didn't hurt the answer.

Spell check in Atom must be enabled by adding scopes per language. Navigate to spell-check settings and add scopes in the grammars field, like this:

source.asciidoc, source.gfm, text.git-commit, text.plain, text.plain.null-grammar, text.html.basic, source.css.scss, text.html.php, source.css, source.js, source.json