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

Instructions for enabling one of these dictionaries in vscode #2857

Open
asklar opened this issue Dec 29, 2023 · 3 comments
Open

Instructions for enabling one of these dictionaries in vscode #2857

asklar opened this issue Dec 29, 2023 · 3 comments

Comments

@asklar
Copy link

asklar commented Dec 29, 2023

I'm trying to enable the win32 dictionary: https://github.com/streetsidesoftware/cspell-dicts/tree/main/dictionaries/win32

I have the cspell vscode extension, but I don't see how I can enable the win32 dictionary, could you please advise?

@Jason3S
Copy link
Collaborator

Jason3S commented Dec 29, 2023

@asklar,

Thank you for the question. It made me realize that there wasn't a CSpell dictionary extension for VSCode. I have added it: Win32 - Code Spell Checker - Visual Studio Marketplace

Getting Started

By default the win32 dictionary is enabled for C and C++ file types. To enable it for other file types, it is necessary to add it to the dictionaries section of the configuration or include it as an inline CSpell directive: cspell:dictionaries win32.

Example: example.md

Sample Code:

```cpp
    // Parse the command line parameters
    int argc;
    LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
    pSample->ParseCommandLineArgs(argv, argc);
    LocalFree(argv);
```

<!--- cspell:dictionaries win32 --->

@asklar
Copy link
Author

asklar commented Dec 29, 2023

thanks @Jason3S for the quick fix!
If I understand correctly, the win32 dictionary is created automatically by running a script on the Windows SDK headers and collecting the words that don't pass according to e.g. the English dictionaries.

There are some more modern terms that are missing from the platform SDK headers (e.g. NuGet, vcpkg).
Would it be possible to manually add these?
Alternately, we should consider additionally including the Windows App SDK to source the list of terms from: https://learn.microsoft.com/windows/apps/windows-app-sdk/

There's bound to be some "noise" in there, e.g. words that aren't actually correct that appear in comments or parameters names. For example, "annotes" is used as a parameter name for "a list of annotations". This may not be a huge deal but just pointing it out in case it is :)

cc @jonwis since he'll be interested too

@Jason3S
Copy link
Collaborator

Jason3S commented Dec 30, 2023

I'll make a change to the dictionary to make it easier to add new terms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants