Vscode-spell-checker: Add to folder dict vs. Add to workspace dict?

Created on 22 Jul 2018  路  7Comments  路  Source: streetsidesoftware/vscode-spell-checker

I've been playing around with both, but I can't find a difference between pressing Add: "..." to folder dictionary and Add: "..." to folder dictionary from the IntelliSense context menu. Both options seem to add the word to the settings.json of the open folder / open workspace?

Most helpful comment

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.

All 7 comments

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:

  1. Default Settings
  2. User Settings
  3. Workspace Settings
  4. Folder Settings

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:

  • "Add to folder" should be fixed so it actually adds it to the folder always.
  • "Add to workspace" should be unchanged IF there is no .vscode/settings.json in the folder of the currently opened file
  • "Add to workspace" should be renamed "Add to workspace and folder" IF there is already an existing .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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Deilan picture Deilan  路  3Comments

gandalfsaxe picture gandalfsaxe  路  6Comments

ili101 picture ili101  路  3Comments

ahmadyousefdev picture ahmadyousefdev  路  3Comments

apptimise picture apptimise  路  6Comments