VSCode Code Spell Checker work with user dictionary
Asked Answered
G

1

8

In my company, we're using VS Code together with the Code Spell Checker extension for Latex documentation. Now I'd like to create a company-wide used dictionary so that not every user has to add the specific words to its own dictionary. But I couldn't find the right information on how to do this.

I created a txt companyDict.txt file on the server so that it's available for everyone. Then I added the following lines to my VS Code settings.json

"cSpell.dictionaryDefinitions": [
        {"name": "CompanyDictionary", "path": "//server/Documentation/Template/companyDict.txt"}
    ],
    "cSpell.dictionaries": [
        "CompanyDictionary"
    ],

Should that work so far? Do I have to possibility to tell the spell checker to add new words specifically to this dictionary or are user dictionaries "read-only"? How does such a user dictionary look like?

Garget answered 19/10, 2021 at 7:31 Comment(0)
G
5

It took me a minute to figure this out, as well. There are at least two ways you can accomplish this:

  1. You can add words to the user settings via the context menu: spelling context menu
  2. You can find the words that have been added via Preferences: Open user settings (JSON) and searching cspell; it will be under cspell.userWords. You can then make this list public at your company, and anyone using the spell checker can paste them in.

OR:

  1. Before adding any words, select "Create a CSpell Configuration File" from the same context menu (see screenshot).
  2. Now, add words via "Add words to User Settings."
  3. Words will be added to this configuration file, which you can then share. I believe it's in ~/.cspell/ by default, but if you can't find it, go to Preferences: Open user settings (JSON) again, and its location will be under cSpell.customDictionaries.
Gnathonic answered 21/10, 2022 at 19:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.