Open gandalfsaxe opened 6 years ago
After a bit of testing I found the following behavior:
Case 1: Opened folder - Add to folder/workspace does the same thing, which is to add the word to .vscode/settings.json of the opened folder.
Case 2: Opened workspace - Add to folder/workspace does the same thing, which is to add the word to [WORKSPACE-NAME].code-workspace of the opened workspace.
But in both cases, choosing Add: "..." to folder dictionary
and Add: "..." to workspace dictionary
does the same thing. Unless there is a case where they are different, they should combined into one command?
It is possible that they are doing the same thing, but that is not what was intended.
But you bring up a good point, it is not obvious of the difference.
Here is the challenge, settings are applied in the following order:
If a setting appears in the folder level, it will overwrite the same setting from either the workspace, the user, or default settings.
If you add a word to the Workspace, then it also needs to be added to the Folder level, otherwise it will still be marked as incorrect.
So as I understand you:
.vscode/settings.json
in the folder of the currently opened file.vscode/settings.json
(that contains a "cSpell.words" attribute) AND be changed to actually do this.What if I have cspell.json
in the root of my project, and I want to add the words only to it, not to .vscode/settings.json
? Is my understanding correct that the extension currently can't do this?
Thank you for all the discussion. I do not mean to be silent. I have just been busy.
This is not an easy problem to solve for the different use cases. It is made worse by the fact that the context menu is static.
I'll take another look at the logic.
Case 1: Opened folder - Add to folder/workspace does the same thing, which is to add the word to .vscode/settings.json of the opened folder.
Case 2: Opened workspace - Add to folder/workspace does the same thing, which is to add the word to [WORKSPACE-NAME].code-workspace of the opened workspace.
With the current version of VSCode (1.27.2) and the current version of the extension, when I have a code-workspace
file open, neither of these options work. The words do get added to the .code-workspace file, but still show up as spelling errors even after closing VS Code and relaunching it.
What I see is that the word gets added to both cSpell.json (if one exists) AND workspace settings.
I very much need this extension to NOT add anything to the workspace file. I have CI doing spell check against cSpell.json and what happens is that a word is marked as valid in one project of a workspace (to both files) and is not marked in other projects' cSpell files. Then, for other project, VS Code deems the word valid, but CI does not (because relevant cSpell file is not updated). I currently have to periodically manually clean up my workspace file.
I've been playing around with both, but I can't find a difference between pressing
Add: "..." to folder dictionary
andAdd: "..." to folder dictionary
from the IntelliSense context menu. Both options seem to add the word to thesettings.json
of the open folder / open workspace?