Tom de Geus
Tom de Geus

Reputation: 5985

Use spell-check in code comments

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...

Upvotes: 18

Views: 10006

Answers (3)

Nikita
Nikita

Reputation: 248

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

Upvotes: 7

Harishs
Harishs

Reputation: 51

Scope name is the solution. add source.python for python. For any other languages do this,

You can find the scope name of a particular grammar by:

Open a file that uses that grammar Open the Developer Tools (View > Developer > Toggle Developer Tools) Switch to the Console tab Place the cursor anywhere in the file in question Open the Command Palette and execute the command Editor: Log Cursor Scope An array of strings will be logged, the first item in the array is the scope name for that grammar.

Upvotes: 5

Andrew Vink
Andrew Vink

Reputation: 331

Stumbled across this thread and noticed the link above is broken.

To enable Markdown and LaTeX spell check in Atom add the following to the "spell-check" package in Atom.

Atom Packages > spell-check > Settings > Grammars > "Add the following"

text.tex.latex, source.gfm

Hope this helps!

Upvotes: 0

Related Questions