54

When I use eclipse and see my name in the javadocs as the author, I also find the spellchecker marking my name as it does not understand that it is a proper name. Thus, I get the option of:

Add {word} to dictionary

but when I click on it, It says the user dictionary is missing and asks if I would like to create a new one. When I say yes, it just shows the spell checking preferences with a blank user dictionary field where I have the option to only add an existing user dictionary and no option to create a new one.

How do I create the user dictionary so that I can configure it for use in eclipse?

MozenRath
  • 9,652
  • 13
  • 61
  • 104
  • 2
    I blame eclipse dialog's poorly labelled field. From the way it is phrased, it looks like you need to select an existing dictionary somewhere. My hope is that they change the label to convey proper meaning. – Scalable Apr 08 '16 at 12:40
  • totally agree with you there, mate! – MozenRath Apr 12 '16 at 11:31
  • Somehow this has never been a problem for me in IntelliJ or NetBeans, but obviously it's been a problem for a lot of Eclipse users... – Alonso del Arte Oct 28 '21 at 17:24
  • But, to be fair, for common misspelled words, the Eclipse spell checker is smarter than the NetBeans spell checker. – Alonso del Arte Oct 28 '21 at 17:45

5 Answers5

57

When in C/C++, you must change the "Select spelling engine to use" option at the top of that options page to be "C/C++ spelling engine".

enter image description here

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
Adam Caviness
  • 3,424
  • 33
  • 37
  • 1
    Thanks! This issue is also discussed here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=310237 – Tor Klingberg Feb 10 '15 at 11:47
  • 6
    If you don't do this, everything appears to work, but nothing actually happens when trying to add new words from C++ code. – fadden Jun 29 '16 at 01:00
  • 2
    I was missing the Select spelling engine to use drop down - this seems so counter intuitive when you click the 'add new dictionary' button after trying to add a word to it. This was driving me crazy. +1 – syntheticgio Mar 28 '17 at 13:00
  • Ah ha! After applying your change, fiiiiiiiinally this answer works now!: https://stackoverflow.com/a/23237328/4561887. It takes both your change and his! – Gabriel Staples Apr 20 '19 at 01:46
  • This blog post points out this answer too: https://syncor.blogspot.com/2011/03/eclipse-adding-user-dictionary-for-cdtc.html. – Gabriel Staples Feb 08 '21 at 07:38
  • How do I even find that dialogue, it doesn't seem to exist on Version: 2023-06 (4.28.0) - LInux? – m4r35n357 Jul 19 '23 at 09:03
  • I looked in "project preferences", nothing, then eventually realized there are "window preferences" too! Still nothing though, I started to glaze over at all the options, what a mess! – m4r35n357 Jul 19 '23 at 09:30
54

Yes, you can.

Create a text (.txt) file in a directory on your computer. Your Eclipse workspace may be appropriate. Add a new word on each line in the .txt file. You don't have to remember every word, that's what the help option is for, when you type a misspelling/a word eclipse doesn't know.

Go to WindowPreferencesGeneralEditorsText EditorsSpelling and find the User defined dictionary section. To the right of that is a button called "Browse" click it, navigate to your text file, and choose it. You'll need to restart Eclipse in order for the changes to take effect.

You can also just type in the text box next to "User defined dictionary" in the Spelling Menu the path to where you want the file to be. It doesn't have to exist, but you must be familiar with paths if you want to do this.

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
DonyorM
  • 1,760
  • 1
  • 20
  • 34
  • 3
    As of Eclipse Neon.3 (4.6.3) it does not need to be a .txt file; it can have a different extension and perhaps no extension and you must close and reopen Eclipse in order to get the newly applied user dictionary to take effect. – H2ONaCl Jul 25 '17 at 20:27
  • It would be nice to add the above comment about having to reset eclipse to the answer. – Mark Walsh Jul 08 '19 at 21:57
  • finally got around to working out how to do this :-) I have got very frustrated with just following the clicks telling me 'how to add a dictionary', and then not! The advise given with explicitly **Window → Preferences → General → Editors → Text Editors → Spelling**, then restart eclipse worked. BTW I'm on eclipse - Version: 2023-03 (4.27.0) – Bill Naylor Apr 11 '23 at 18:33
  • This answer worked for me (no need to restart either). I have downvoted the one that did not. – m4r35n357 Jul 19 '23 at 09:33
10

The user dictionary is just a plain text file with one word per line.

You do not have to create this file, just put the path to where you want to store the file in the 'User defined dictionary' configuration that Eclipse shows you and it will create the file.

greg-449
  • 109,219
  • 232
  • 102
  • 145
0

Another thing to watch out for, at least in Eclipse Kepler, is that the dictionary cannot be located in C:\ProgramFiles\eclipse. I could not add words to the dictionary when I put the file there, maybe because it doesn't have permission to that directory.

Rob
  • 123
  • 1
  • 10
0

I'm late to the party, but for Eclipse I kept having a spelling check error pop up for the word "accessor" that I was using in a comment for a school project. I found that using @DonyorM / @Gabriel Staples comment helped me solve this problem.

I just went to Window → Preferences → General → Editors → Text Editors → Spelling and typed in the word I needed to add next to the "User defined dictionary" box. I then clicked browse, created a folder in my workspace labeled as "ECLIPSE DICTIONARY", then created a text file labeled as "DICTIONARY" in that folder. After creating and directing eclipse to use that pathway, it added the word automatically to the text file.

(Also, for clarification you don't have to label the folder and text file to what I labeled it as. I'm sure you could name it whatever you wanted.)

Now I don't have to look at that pesky red line underneath that particular word.