<$BlogRSDUrl$>

Wednesday, January 11, 2006

Eclipse: Catch Those Spelling Errors - www.javalobby.org/java/forums/t17453.html 

Eclipse: Catch Those Spelling Errors * * * *
* * * * *
| | | | | | | |
Username/Email: Password: |

* *

* * * * * *

*

* * * * * *

*

* * *

*

* * * * * * *

*

* * * * *

*

* * * * * * *
Forum Controls

* * *
* *
*


Whos Online:

1,635 guest(s),
35 user(s).

(sponsored)
Live Javalobby Chat! Join other Javalobby members in a .
Login with your username and password to join.
Rooms (4):
User Count:
Swing
0
Java EE
0
EclipseZone
0
More Rooms Available...
Spotlight Features
Web Tools Platform project leader Tim Wagner balances the competing
interests of open source and commercial development in what may be
the most closely watched of all the Eclipse projects. In this
exclusive interview, find out how he does it, and why.
The truth is out there, and JL's Erik Thauvin never misses it! Last
year, the Javalobby Newsletter published 46 editions of Erik's Pulse.
Erik assembled a great summary of them in this mega-list.
Javalobby's tip-meister, R.J. Lorimer, introduces you to Wicket and
shows you why it is uniquely powerful and not just another Java MVC
framework. Enjoy!
RCP enthusiast, J Aaron Farr, says you should be using Eclipse RCP.
Don't believe him? Check out his 10 minute screencast showing the
functionality that proves why Java on the desktop isn't dead!
JavaPolis 2005 wrapped up last week and Julien Delfosse gives an
incredible overview of the sessions he attended and his overall feel
of the show. Synopsis: good show, good drinks, too many guys!
Threads: [ | Next ]

ECLIPSE: CATCH THOSE SPELLING ERRORS
At 11:36 PM On Feb 24, 2005, Wrote:
Ahh, spelling errors. I think we all make them - I know I do
anyway. After typing these tips on a near daily basis I've begun to
recognize that no matter how good you think you are at spelling,
stupid mistakes show up, and a lot of times you get a bad spelling
habit stuck in your head and continually put too many c's in
necessary or something. I would be surprised if a spelling error
didn't find its way in to this very tip, as I'm usually too lazy to
put a lot of effort into spell checking these .

Spelling errors in documentation can mean the difference between
life and death. Really?! No... not really - but spelling _is _
important. Bugs are opened in large frameworks when spelling and
grammatical errors are in the documentation. Really, it happens! In
addition, people immediately take you more seriously when you spend
the time to ensure that your spelling is accurate. Finally, it is
definitely possible that spelling errors can convey a different
meaning than intended. (Deprecate and Depreciate anyone?)

Thankfully, Eclipse has a little hidden gem that makes quick work
of spelling errors. The spelling support in Eclipse has actually been
around for a while now (if I'm not mistaken, it was enabled in 3.0),
and recently (3.1 M4) it was enabled in the properties file editor in
addition to the already supported Java editor. So, how do you enable
it?

Well, the first step is to find the preference for it. That's a
relatively simple process as I already know, and I am going to tell
you - just go to Window->Preferences->Editors[+]->Text
Editors[+]->Spelling and check Enable Spelling .
Oops, wait a minute... it has a section to provide a 'User defined
dictionary'. Is this mandatory? What format does it need to be in? Do
we have to type all the words by hand? This could take a while! For
spell checking to work, it is currently mandatory for you to provide
a dictionary. Thankfully it's not that hard to find a word-list
Eclipse can use. Eclipse supports a fairly standard one-word-per-line
format for the 'dictionary' file, so we just have to find one of
those. The best branching off point for that is probably . Seem too
hard? Ok, fair enough. I've compiled my own word list off of an
amalgum of lists (I honestly can't remember which ones, otherwise I
would be sure to give credit where credit is due), and I have
uploaded it . Fair warning! This file is substantial in size - so
substantial that I couldn't attach it to this message in the
conventional Javalobby 'Attach File' way (around 1.5 megabytes).

Ok, so now let's enable our spell-checking. I like to drop the
dictionary file in the folder with my Eclipse installation, and then
reference it in the preferences, as seen here:
Then all you have to do is use it. Spell checking shows up in one
of two ways - first as squiggly warnings in your documentation and
strings, and second as a preemptive auto-complete for content assist
(assuming you have enabled that option in the advanced section seen
in the screenshot above). Here is what the spelling error marker
looks like (and what happens when I press Ctrl+1 with my cursor
adjacent to the error):
Here is what it looks like using the auto-complete feature
(Ctrl+Space):
Unfortunately, spelling support still needs a little work in some
areas; it is no panacea. So, what would I like to see in the future?
For one thing, there is no way yet to control what elements are
spell-checked, and which ones aren't. What I mean by that is whether
javadocs, regular comments, string literals, and/or type/method/field
names are spell-checked. Currently all documentation and string
literals are checked, but that's it. Frankly, my string literals need
checking less often than my types and fields and methods - and in my
string literals, it is more often the spell-checker would be wrong.
In addition, the algorithm used for finding words of a closest match
doesn't always seem the most appropriate - when using the word-list
for auto-complete, if I were to type 'spell' and then press
Ctrl+Space, I would like 'spelling' come up in the list before 'spew'
- since that is the main benefit of an auto-complete feature -
completing the word!

5 REPLIES SO FAR ( )
(sponsored)
* by R.J. Lorimer - Feb 24, 2005 11:36 PM * by Kerry Sanders
- Mar 3, 2005 10:57 PM * by R.J. Lorimer - Mar 3, 2005 11:55 PM *
by Fred Grott - Aug 3, 2005 3:19 PM * by R.J. Lorimer - Aug 3, 2005
4:56 PM * by Fred Grott - Aug 4, 2005 2:23 PM


This page is powered by Blogger. Isn't yours?