Eclipse Zone is brought to you in partnership with:

Erich is Professor at Lucerne University of Applied Sciences and Arts and Distinguished Member of Technical Staff at Freescale Semiconductor. Erich has a MsCS degree and 18+ years of experience in the embedded software and tools world. He created many embedded cross C/C++ compilers and debuggers. Additionally he is researching in the domain of programming languages, real time and mechatronic systems. Erich is a DZone MVB and is not an employee of DZone and has posted 132 posts at DZone. You can read more from them at their website. View Full User Profile

Eclipse Spell Checker

02.06.2013
| 6770 views |
  • submit to reddit

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 :-)

 

Published at DZone with permission of Erich Styger, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)