Red_Phoenix
Red_Phoenix

Reputation: 507

Global Ignore Spelling Directive in Visual Studio

In Visual Studio 2022, you can add the directive // Ignore Spelling: WordToIgnore in a file to ignore said word. Is there a way to do this globally for the solution? I do not want to add it to the Ignore Words File because I do not want to affect other solutions. I also would like to not add this line of code to every file that I want it in.

Upvotes: 2

Views: 1320

Answers (2)

Eliahu Aaron
Eliahu Aaron

Reputation: 4562

The Visual Studio Spell Checker extension defines an Ignore Spelling Directive in the form // Ignore Spelling: WordToIgnore so I assume you are using this extension.

Visual Studio Spell Checker allows configuration options using the .editorconfig file. To add an .editorconfig file to the solution, right click on the solution and select Add -> New EditorConfig.

Here are two ways to add words to the spell checkers ignore list:

Using the Ignored Words/Keywords List

  1. Right click on the .editorconfig file and select Spell Checker Congiuration.
  2. On the left menu, select Ignored Words/Keywords.
  3. Type the word to ignore in the Ignored Words List or the Ignored Keywords List text box and click Add.

Using Ignored Words File

  1. Right click on the solution and select Add -> New Item.
  2. Add a file named IgnoredWords.dic.
  3. Add the words to ignore to the new file, a word per line.
  4. Right click on the .editorconfig file and select Spell Checker Congiuration.
  5. On the left menu, select Ignored Words/Keywords.
  6. Under Ignored Words File, click on the ... and select the IgnoredWords.dic.

Note: the Ignored Words File file can have any name, placed at any location and does not need to be added using the solution.

See:

Spell Checker Settings (.editorconfig file): Spell Checker Configuration

Upvotes: 1

Mike Nakis
Mike Nakis

Reputation: 62110

A claim made within this question is in direct conflict with fact:

There is no such thing as a // Ignore Spelling: "directive" in Visual Studio 2022.

I have never seen such a "directive" being mentioned in any documentation I have read, (and I have read a lot,) and an attempt to try to include such a directive within my code to see if by any miracle it works was just a waste of time: of course, it does not work.

Maybe some plugin used by the author supports such a "directive".

(Perhaps "Visual Studio Spell Checker" by EWSoftware.)

Which means that the answer that the author is seeking must lie within the documentation of that plugin.

Visual Studio 2022 comes with its own built-in spell checker, which is configurable via .editorconfig, and which can be configured to learn ("exclude" in microsoft parlance) words at the solution scope or even at the project scope. However, I cannot recommend using the Visual Studio 2022 built-in spell checker, because it does not work for me.)

Upvotes: 0

Related Questions