Eclipse Spell Checker


One of the nice things of modern IDE’s are: they offer many extras for free. Many times it is related to programming and coding. But I love as well the ones which makes things easier and better which is not directly related to the executed code. One thing Eclipse offers is an on-the-fly spell-checking, similar to Microsoft Word:

Spellchecked Sources

Spellchecked Sources

Hovering over the text offers me to correct the flagged error:

Initialization vs. Initialisation

Initialization vs. Initialisation

But wait: is that example not spelled correctly?

And indeed, Eclipse offers to customize the spell checking. The option page is in the Windows > Preferences > General > Editors > Text Editors > Spelling page:

Spelling Preferences

Spelling Preferences

‘Initialization’ vs. ‘Initialisation’: that’s an ‘English US’ vs. English UK’ thing, and is easily changed. And I prefer the US English:

Changing Dictionary

Changing Dictionary

With this, everything is ok now:

not flagged any more

not flagged any more

:idea: After changing the platform dictionary, it usually takes a few minutes until the sources are checked again.

But what if Eclipse does not know a word? Then it offers to add it to a dictionary:

Adding to the dictionary

Adding to the dictionary

If I do not have a user dictionary yet, it will prompt a dialog:

Missing User Dictionary

Missing User Dictionary

If pressing ‘Yes’, it will prompt the settings page from above where I can specify my user dictionary file:

User defined dictionary

User defined dictionary

The user dictionary is a normal text file with one word on each line. That makes it easy to edit and to have it in a version control system.

:idea: I have one common dictionary file for all my workspaces. But of course it is possible to have different dictionaries per workspace, as the settings are per workspace too.

Summary

I feel having reasonable spelled comments in the sources is just something an engineer should care about. And the Eclipse spelling engine does not have to be as good as the one in MS Word (which is pretty good in my view). But for making sources better something like correctly spelled comments is a plus. But only if the code works like a charmĀ :mrgreen:

Happy Spelling :-)

About these ads

6 thoughts on “Eclipse Spell Checker

  1. Pingback: Top 10 Customization of Eclipse Settings | MCU on Eclipse

  2. I need to spellcheck a C++ project on Linux and Eclipse’s spell checker seems to be the best I found in Linux’s IDE’s. The only thing I miss about it is the ability to do some kind of a “batch spellcheck” the way F7 in MS Word does. It would be great if Eclipse could direct you to lines with misspelled words just like it directs you to lines with C++ syntax errors.
    Thanks for the article!

    Like

    • Hi ThorX89,
      you are welcome! And yes, I wish there would be a way to jump to the next spelling error, or to have a list/report of the errors. I have seen some requests around this in other forums, but not seen it implemented (yet).

      Like

      • Hi Erich. I ended up solving the problem right after posting my comment here. Turns out both KDE Kate and KDevelop do have a nice spellchecker that can jump from error to error just like MS Word does, and it supports spellchecking code (i.e., it checks string literals and comments but not the actual code). The only downside (and Eclipse suffers from this too) is that code identifiers and language keywords don’t get ignored automatically. (See https://bugs.kde.org/show_bug.cgi?id=321593 ). Really useful if you have a fairly large codebase with lots of documentation that you didn’t write with a spellchecker on (my case).

        Like

  3. Pingback: How to re-enable ‘Add to dictionary’ for the Eclipse Spell Checker | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s