Skip to content

Commit b8c89ff

Browse files
Readability updates to spell checker doc
1 parent 6e64d8c commit b8c89ff

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

docs/ide/text-spell-checker.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Learn about the Spell Checker"
33
description: Learn how to use the Spell Checker in Visual Studio to correct misspelled words in multiple languages and to customize it to share with your dev team.
4-
ms.date: 05/24/2023
4+
ms.date: 08/27/2024
55
ms.topic: conceptual
66
author: anandmeg
77
ms.author: meghaanand
@@ -36,7 +36,7 @@ Because C#, C++, and Markdown all use English as the language for their keywords
3636
> [!NOTE]
3737
> C# and C++ also have additional dictionaries for keywords in those languages, which prevents words like ‘namespace’ or ‘alloc’ from being flagged as misspelled words.
3838
39-
Feedback from early users of this feature informed us that developers only want to know about errors in the document they are currently working with. In response to that feedback, the spell checker only scans the document(s) that are active in the editor. In direct response to this feedback, the spell checker scans documents that are open.
39+
Feedback from early users of this feature informed us that developers only want to know about errors in the document they're currently working with. In response to that feedback, the spell checker only scans the documents that are active in the editor.
4040

4141
The following table shows some of the heuristics that the **Spell Checker** looks at when it scans a code document:
4242

@@ -50,7 +50,7 @@ The following table shows some of the heuristics that the **Spell Checker** look
5050
| btnWorld | World, world | Fragments of three characters or fewer are ignored |
5151
| helloworld | Helloworld, helloworld | No indicator to identify word boundaries |
5252

53-
If Visual Studio finds a match for the token in any of the dictionaries it's using, the token is considered acceptable and the scan carries on. Otherwise, the token is considered misspelled and Visual Studio flags it as a spelling error.
53+
If Visual Studio identifies a match for the token in any of the dictionaries it's using, the token is deemed acceptable, and the scan proceeds. Otherwise, the token is considered misspelled and Visual Studio flags it as a spelling error.
5454

5555
:::image type="content" source="media/vs-2022/text-spell-checker-error-list-example.png" alt-text="Screenshot of an example of spelling errors in the Error List.":::
5656

@@ -60,12 +60,13 @@ You can customize the spell checker so that it's optimized for a collaborative e
6060

6161
By configuring an EditorConfig file, you can establish the coding standards that you expect everyone to follow, which allows you to maintain a coding consistency that might be difficult through other methods.
6262

63-
Here are some examples and use-case scenarios of the switches you can configure in an EditorConfig file:
64-
65-
66-
- Apply the spelling options to a specific set of files. **This is a required specification to add, as spelling error options are file-specific.** In this example, the spelling options are applied to all C# files in the solution.
63+
> [!IMPORTANT]
64+
> Spelling error options are file-specific. You must specify which files spelling options are applied to. In the following example, the spelling options are applied to all C# files in the solution.
65+
6766
```[*.cs]```
6867

68+
Here are some examples and use-case scenarios of the switches you can configure in an EditorConfig file:
69+
6970
- List the languages for Visual Studio to use. In this example, Visual Studio would only use the "en-us" and "fr-fr" dictionaries when checking for spelling issues.
7071

7172
```spelling_languages = _language_[,_language_]```<br>
@@ -84,38 +85,38 @@ Here are some examples and use-case scenarios of the switches you can configure
8485
```spelling_error_severity = error OR warning OR information OR hint```<br>
8586
```(Example: = error)```
8687

87-
- Create your own exclusion dictionary to specify words you consider to be correctly spelled. In this example, the first time the Spell Checker is run against any file in the solution, Visual Studio checks for an exclusion.dic file in the same directory as the .sln file (for a C# project) or in the root directory (for a C++ directory). If no exclusion.dic file exists, the Visual Studio creates one. Then, whenever the user chooses to ignore a word, Visual Studio adds it to this exclusion.dic file. Visual Studio considers any word that appears in this exclusion.dic file as a correctly spelled word.
88+
- Create your own exclusion dictionary to specify words you consider to be correctly spelled. In this example, the first time the Spell Checker runs against any file in the solution, Visual Studio checks for an exclusion.dic file. Visual Studio checks the same directory of the .sln file for a C# project or in the root directory for a C++ directory. If no exclusion.dic file exists, the Visual Studio creates one. Then, whenever the user chooses to ignore a word, Visual Studio adds it to this exclusion.dic file. Visual Studio considers any word that appears in this exclusion.dic file as a correctly spelled word.
8889

8990
```spelling_exclusion_path = absolute OR relative path to exclusion dictionary```<br>
9091
```(Example: = .\exclusion.dic)```
9192

9293
> [!NOTE]
9394
> Visual Studio uses the exclusion dictionary specified by the `spelling_exclusion_path` switch in your .editorconfig file or an exclusion.dic file in your `%localappdata%\Microsoft\VisualStudio\<Version>` directory if a switch can’t be found.
9495
95-
- Control whether the language-specific exclusion dictionary so use. When set to false, any words specified in the exclusion dictionaries specific to C++ or C# won't be used. The default is true.
96+
- Control whether the default language-specific exclusion dictionary is used. This flag is set to true by default. Any words added to the language-specific exclusion dictionary will be considered correctly spelled. Set to false to ignore the exclusion dictionaries specific to C++ or C#.
9697

9798
```spelling_use_default_exclusion_dictionary = true OR false```<br>
9899
```(Example: = spelling_use_default_exclusion_dictionary = false)```
99100

100-
Here is a complete example:
101+
Here's a complete example:
101102

102103
```
103-
[*.{cs,vb}]
104-
spelling_languages = en-us,fr-fr
105-
spelling_checkable_types = identifiers,comments
106-
spelling_error_severity = error
107-
spelling_exclusion_path = exclusion.dic
108-
spelling_use_default_exclusion_dictionary = false
104+
[*.{cs,vb}] //specify which files the spelling options apply to
105+
spelling_languages = en-us,fr-fr //specifies the en-us and fr-fr dictionaries for use in spell checking
106+
spelling_checkable_types = identifiers,comments //specifies that identifiers and comments are the only checked elements
107+
spelling_error_severity = error //sets severity assigned to spelling errors to error in the error list
108+
spelling_exclusion_path = exclusion.dic //defines a custom exclusion dictionary location and file
109+
spelling_use_default_exclusion_dictionary = false //ignores the language-specific default exclusion dictionary
109110
```
110111

111112
## Special case handling
112113

113-
There are a few special behaviors in how Visual Studio checks code for spelling errors that are different from a traditional spell checker that's designed for written text. Some of these behaviors include:
114+
Visual Studio has some unique behaviors when checking code for spelling errors that differ from those of a traditional spell checker designed for written text. Some of these behaviors include:
114115

115-
- In a string that includes punctuation, for example, 'misc.", Visual Studio won't suggest a correction because punctuation in an identifier might result in code that won't compile.
116+
- In a string that includes punctuation, for example, 'misc.", Visual Studio won't suggest a correction because punctuation in an identifier might result in code that doesn't compile.
116117
- Backslashes in a string will omit the subsequent character from being spell-checked and treat the backslash and subsequent character as a word delimiter. For example, in the string `hello\nworld`, Visual Studio detects the backslash first. Visual Studio treats the `\n` as a word delimiter, which leaves "hello" and "world", each of which are checked individually.
117118
- Strings that contain URLs such as `https://...` or `mailto:..` won't be spell-checked over the entire string.
118119

119120
## Related content
120121

121-
- [Improving the Spell Checker](https://devblogs.microsoft.com/visualstudio/improving-the-spell-checker/)
122+
- [Improving the Spell Checker](https://devblogs.microsoft.com/visualstudio/improving-the-spell-checker/)

0 commit comments

Comments
 (0)