How to create a user dictionary in eclipse?
Asked Answered
S

5

55

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?

Safford answered 23/4, 2014 at 7:0 Comment(4)
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.Hortenciahortensa
totally agree with you there, mate!Safford
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...Hague
But, to be fair, for common misspelled words, the Eclipse spell checker is smarter than the NetBeans spell checker.Hague
Q
55

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.

Quietism answered 23/4, 2014 at 7:11 Comment(4)
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.Amaryl
It would be nice to add the above comment about having to reset eclipse to the answer.Lanctot
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)Parrakeet
This answer worked for me (no need to restart either). I have downvoted the one that did not.Limbus
E
58

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

Evenhanded answered 29/1, 2015 at 4:35 Comment(7)
Thanks! This issue is also discussed here: bugs.eclipse.org/bugs/show_bug.cgi?id=310237Curb
If you don't do this, everything appears to work, but nothing actually happens when trying to add new words from C++ code.Systematist
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. +1Counterpoison
Ah ha! After applying your change, fiiiiiiiinally this answer works now!: https://mcmap.net/q/333211/-how-to-create-a-user-dictionary-in-eclipse. It takes both your change and his!Schaub
This blog post points out this answer too: syncor.blogspot.com/2011/03/….Schaub
How do I even find that dialogue, it doesn't seem to exist on Version: 2023-06 (4.28.0) - LInux?Limbus
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!Limbus
Q
55

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.

Quietism answered 23/4, 2014 at 7:11 Comment(4)
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.Amaryl
It would be nice to add the above comment about having to reset eclipse to the answer.Lanctot
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)Parrakeet
This answer worked for me (no need to restart either). I have downvoted the one that did not.Limbus
G
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.

Gudgeon answered 23/4, 2014 at 7:7 Comment(1)
that additional info about not needing to create it helped. Thanks!Safford
P
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.

Paragrapher answered 5/7, 2018 at 3:5 Comment(0)
J
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.

Jitter answered 20/8, 2022 at 5:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.