Skip to content

Commit eed4ef4

Browse files
committed
integrate PM tech review feedback
1 parent 44e8142 commit eed4ef4

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

docs/ide/text-spell-checker.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Learn about the Spell Checker (Preview)"
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/04/2023
4+
ms.date: 05/10/2023
55
ms.topic: conceptual
66
author: TerryGLee
77
ms.author: tglee
@@ -22,7 +22,7 @@ Many of the features in Visual Studio are designed to help you write the code yo
2222
> [!IMPORTANT]
2323
> This feature is still in development. It's available now in Visual Studio 2022 version 17.5, but it'll be refined in future releases. For the latest news, see the [**Improving the Spell Checker**](https://devblogs.microsoft.com/visualstudio/improving-the-spell-checker/) post on the [Visual Studio Blog](https://devblogs.microsoft.com/visualstudio/).
2424
25-
Visual Studio automatically toggles on the Spell Checker feature with any C#, C++, or Markdown file. Visual Studio marks any words that it detects as misspelled words. Visual Studio also suggests alternate spellings and helps correct them. The feature even does a contextual rename when those misspellings are identifiers so that your code still compiles.
25+
The Spell Checker is available for any C#, C++, or Markdown file. When the Spell Checker is enabled, Visual Studio marks any words that it detects as misspelled words. Visual Studio also suggests alternate spellings and helps correct them. The feature even does a contextual rename when those misspellings are identifiers so that your code still compiles.
2626

2727
You can turn the spell checker off or on by using the **Toggle Text Spell Checker** button on the main toolbar, or by selecting **Edit** > **Advanced** > **Toggle Text Spell Checker** command from the menu bar.
2828

@@ -40,7 +40,10 @@ You can also choose to ignore the spelling issue. By choosing to ignore the issu
4040

4141
Because C#, C++, and Markdown all use English as the language for their keywords, Visual Studio typically uses the "English (United States)" or "en-us" dictionary for spell checking. Visual Studio checks the instance of Windows for the display language it's using, and if it's not "en-us", it uses that dictionary as well.
4242

43-
Feedback from early users of this feature informed us that developers wanted to know about errors in the documents they were currently working with. In direct response to this feedback, the spell checker scans documents that are open.
43+
> [!NOTE]
44+
> C# and C++ also have additional dictonaries for keywords in those languages, which prevents words like ‘namespace’ or ‘alloc’ from being flagged as misspelled words.
45+
46+
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.
4447

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

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

57-
Otherwise, Visual Studio considers the word misspelled and flags the token as a spelling error. Visual Studio displays the spelling error with a severity of "Message" in the Error List with a "SPELL" Code.
60+
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.
5861

5962
:::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.":::
6063

@@ -72,7 +75,7 @@ Here are some examples and use-case scenarios of the switches you can configure
7275
```(Example: = en-us,fr-fr)```
7376

7477
> [!NOTE]
75-
> Make sure to install the [language pack](../install/install-visual-studio.md) for any non-default language you're using to prevent Visual Studio from incorrectly flagging words as spelling errors.
78+
> Make sure to install the [language pack](../install/install-visual-studio.md) for any language you're using to prevent Visual Studio from incorrectly flagging words as spelling errors.
7679
7780
- Control what Visual Studio should check. In this example, Visual Studio would check identifiers and comments for misspelled words but wouldn’t check inside strings.
7881

@@ -90,7 +93,7 @@ Here are some examples and use-case scenarios of the switches you can configure
9093
```(Example: = .\exclusion.dic)```
9194

9295
> [!NOTE]
93-
> 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. In either case, the spell-checking APIs require the exclusion file to have "UTF-16 with BOM" encoding to work correctly.
96+
> 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.
9497
9598
- 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.
9699

@@ -99,10 +102,10 @@ Here are some examples and use-case scenarios of the switches you can configure
99102

100103
## Special case handling
101104

102-
In Visual Studio, some strings aren't recommended for spell-checking. Other strings aren't spell checked or aren't spell checked in their entirety.
105+
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:
103106

104-
- Strings that include punctuation aren't recommended. For example, `misc.` isn't recommended as it could result in code that won't compile.
105-
- Backslashes in a string can omit the subsequent character from being spell-checked. For example, `\nhello` won't be flagged as a spelling error because the "n" is omitted and "hello" is a correctly spelled word.
107+
- 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.
108+
- 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.
106109
- Strings that contain URLs such as `https://...` or `mailto:..` won't be spell-checked over the entire string.
107110

108111
## See also

0 commit comments

Comments
 (0)