EWSoftware / VSSpellChecker

A Visual Studio spell checker editor extension that checks the spelling of comments, strings, and plain text as you type. Supports configuration and various languages.
Other
377 stars 65 forks source link

Combine solution and project user dictionaries when spell checking #208

Closed graymatter00 closed 4 years ago

graymatter00 commented 4 years ago

Hello,

I'm having trouble configuring Spell Checker the way I'd like. I have a solution with three projects. I have a user dictionary for the solution as well as a user dictionary for each project.

The solution user dictionary will contain custom words applicable to the solution and all projects. The user dictionary for each project will contain words applicable only to the project in which it exists.

Example: Solution user dictionary contains: aaa bbb ccc Project 1 user dictionary contains: ddd eee Project 2 user dictionary contains: fff ggg Project 3 user dictionary contains: hhh iii

So, when spell checking project 2, I'd like the spell checker to use the combination of the solution user dictionary and the project 2 user dictionary. That would be , aaa, bbb, ccc, fff, ggg.

I have created user dictionaries and configuration files in the solution and each project. Screen shots attached.

I cannot find a configuration that includes/combines the solution user dictionary with the project dictionary. That is, using the example above, when spell checking project 2 only the project 2 user dictionary is used: fff, ggg.

What am I doing wrong? Please advise.

Global Solution Project

EWSoftware commented 4 years ago

I need to clarify this in the documentation as right now the description is only applicable to solutions with a single project. The dictionaries are global resources so if you have multiple project-specific dictionaries, only the first project that creates the dictionary will get it's project-specific dictionary added to it and it will be used across all projects since they are all using the same dictionary. Since subsequent projects won't create the dictionary any user dictionaries in their configurations are ignored. Likewise, if a solution configuration contains a user dictionary and a project contains a user dictionary, the project user dictionary would override the solution-level one rather than being additive to it.

The only way to do what you want is to make the dictionaries project-specific too but that would be too expensive as the dictionaries are quite large. Putting the words in the ignored words list instead should achieve what you want as ignored words are specific to each project's configuration not the dictionary. The only downside is that they would not be offered as corrections for other misspellings.

graymatter00 commented 4 years ago

Thanks for the quick reply Eric. And thanks for the product.

Yes, updating the documentation to clarify what is and is not possible is a good idea. I spent a lot of time configuring and testing scenarios. C'est la vie :)

Based on what you've told me, I've decided to go with the solution and each project having configuration files, but just one user dictionary at the solution level.

This allows me to add words to the user dictionary at the solution level, which is available to all projects; and still have the ability to use the Ignored Words, Ignored Files, etc. at the solution and project levels if needed. Combined with the Ignore Spelling Directive in some files, I think this is the best setup for me. Not perfect - but it gets the job done.

Looking forward... You state that the dictionaries are global resources. Is that final? Is that likely to change or be worked-around? Is there any chance that a future version could achieve my original requirement?

All the best.

EWSoftware commented 4 years ago

Yes, that is final. The next release loads them asynchronously to prevent some blocking issues that can occur but they are still shared resources and will remain so.