Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 12 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Eclipse: Catch Those Spelling Errors

At 11:36 PM on Feb 24, 2005, R.J. Lorimer 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 Kevin's Word List on Sourceforge.net . 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 here . 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!

1 . At 10:57 PM on Mar 3, 2005, Kerry Sanders wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Nice post. I didn't realize that Eclipse had a spell checker built in. I have worked on some code in the past few years that could have been greatly improved if the developer had been using a spell checker. :)

Kerry
Kerry's Abend
Kerry Sanders
Ramblings of a Programmer
2 . At 11:55 PM on Mar 3, 2005, R.J. Lorimer wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Kerry,

Glad you found it helpful. Thanks for the feedback.

Cheers,
Best, R.J. Lorimer
3 . At 3:19 PM on Aug 3, 2005, Fred Grott DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

RJ,

You need to change the .txt extension to dictionary for the it to work..
Fred Grott, ShareMe jabber:fg82183@conference.javalobby.org(shareme) Official contributor to EclipseZone.com and supporter of JavaLobby.org.
4 . At 4:56 PM on Aug 3, 2005, R.J. Lorimer wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Fred,

I was able to get mine to work without changing the extension - I pulled that .txt file directly out of my workspace. You may have to change the file browse setting to 'All Files' however.

Regards,
Best, R.J. Lorimer
5 . At 2:23 PM on Aug 4, 2005, Fred Grott DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Hmm...

I did not tha tin Eclipse3.1 you can enable it for all editors..

Did Eclipse Foundation ever come out with a global wordlist to load as platform?
Fred Grott, ShareMe jabber:fg82183@conference.javalobby.org(shareme) Official contributor to EclipseZone.com and supporter of JavaLobby.org.
6 . At 1:42 AM on May 20, 2006, nielinjie wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Can this function handle 'multiple word' term -
example: I have a statement-
SomeAbstractType iAmAProperty=new SomeType();
for this statement, can this function check all words' spelling - some, abstract, type, i, am, a, property
7 . At 4:50 AM on Jun 6, 2007, Marius Cetateanu wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

I cannot download the dictionary file. It says i do not have permissions.
8 . At 4:47 AM on Jun 28, 2007, Nebula wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Yeah, I guess he removed those files.
What you can do is download the aspell program from http://aspell.net/win32/ (I assume you use windows). From that page you can also download all sorts of dictionaries.
Open a command line and change to the Aspell 'bin' directory. Issue the command 'Aspell.exe dump master en > en.dictionary'. This will create a plain text file containing all the English words. If you want to create another word list just replace the 'en' with the two letter combination of the langue you require. Use the newly created file as a user defined dictionary. Now you will have spell checking in Eclipse!!!

Good luck!
9 . At 5:41 PM on Aug 22, 2007, Srinivas wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

screen shots are not visible.
Also gives permission error for
http://www.javalobby.org/images/postings/rj/eclipse_spelling/dictionary.txt
10 . At 2:38 AM on Aug 26, 2007, Javanewcomer wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

I can't see these screen shots too.
Please check it.
I need it.
Java Tutorial
Java Software
11 . At 12:24 PM on Mar 12, 2008, Jon Kosmoski wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

I realize the spelling checker is general and works with any text editor, but in the JDT I'd like to have spelling errors flagged as compiler warnings. Is it possible?
12 . At 3:02 PM on Mar 12, 2008, perlon wrote:
  Click to reply to this thread Reply

Re: Eclipse: Catch Those Spelling Errors

Nebula - thanks for link to cool program, i don't knew about them, but i needed! Thanks.

thread.rss_message