Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all words in the current document to dictionary #59

Closed
laggingreflex opened this issue Jan 15, 2017 · 13 comments
Closed

Add all words in the current document to dictionary #59

laggingreflex opened this issue Jan 15, 2017 · 13 comments

Comments

@laggingreflex
Copy link

Please add an option to add all words in the current document (that are deemed incorrect) to the project/global/custom dictionary.

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 15, 2017

I understand the desire for this feature. At the same time, I would like to get better idea of what issue you are trying to address. Are you seeing a LOT of words that do not match? Does another language needed to be added? Or is it necessary to turn on compound words?

@laggingreflex
Copy link
Author

laggingreflex commented Jan 15, 2017

I use a lot of other people's projects that have words that are flagged as incorrect and I don't necessarily need to, or even can, correct them, so I would rather wish to add all those words in the project dictionary. Some projects also contain words that I would like to add to my user dictionary as well.

Often times there are a LOT of words, I currently have to do this for each word.

My main intention is to clear all spelling related annotations over the vertical scroll bar on the right so it doesn't interfere with other features of it, like code changes, breakpoints, errors etc. edit: although I do want any un-intentionally left spelling errors to be highlighted there.

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 15, 2017

Just curious, which programming language do you use?

The easiest way to add this feature is to make it an F1 command. Like: F1 + add all word to dictionary. Which will show a possible set of commands to pick from.

@laggingreflex
Copy link
Author

Sounds good. I mainly use Javascript.

@bergwerf
Copy link

This would be very useful for me too. A lot of my variable names are flagged (I use abbreviations, such as ivec for the i unit vector). I usually disable spellcheck again after a while because it distracts me (flags too much words, mixes with linting errors etc.), but this feature would make it possible to quickly create your own 'dictionary'. (just installed it, already got a couple of spelling mistakes in my comments!).

@lucasbento
Copy link

Just an addendum to this feature, would be nice to have a right-click-menu item named Add this word to dictionary that shows up when you select a word.

@Jason3S
Copy link
Collaborator

Jason3S commented Sep 27, 2017

@lucasbento good idea.

Jason3S added a commit that referenced this issue Oct 3, 2017
@Jason3S
Copy link
Collaborator

Jason3S commented Oct 3, 2017

I have taken the suggestions and added this feature in the following way:

  1. Select the text you want to add to the word list.
  2. Right click on the text and choose which word list to add it to:
    • Add Word to Dictionary
    • Add Word to Global Dictionary

The extension will split the words and add them to the chosen dictionary.

@laggingreflex
Copy link
Author

@Jason3S Sorry for coming back to this after such a long time. Thanks for implementing it. I just tested it in a couple new projects. It's proving very useful indeed.

But I have a concern.

This seems to add all words in the selected text to the dictionary. While it does solve the problem, but it seems a bit excessive, no? A typical code file may have thousands of words. Most of them already recognized by the default dictionary, so adding them is redundant. It may also have performance impact as the dictionary grows.

I currently, in all my usage of this plugin over the years, have accumulated ~600 custom words. But using this to add all words in a single file of a new project almost doubled it. Although the list does plateaus after adding the most used words in English.

It's fine for now, and does the job well, but I think it'd be nice to improve this feature if possible by only adding the custom words.

@mortezaataiy
Copy link

At lest please support that in PROBLEMS section. When select multiple word we cant add all of them to dictionary.
image

@mortezaataiy
Copy link

Or some time we are starting an existing big project and old words is not important. This feature is very useful in this situation. Thanks ❤

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 16, 2022

@mortezaataiy,

Something to try. Use the cspell command line tool to get the list of words for a new project.

The following will search all files (the "**") and put the ones it found into a file called words-found.txt.

npx cspell "**" --no-problems --no-progress --unique > words-found.txt

The code spell checker extension uses the CSpell Library to do the spell checking. Which means both cspell and this extension will use any settings found in cspell.json files, hopefully making things easier.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants