diff --git a/docs/docs/case-sensitive.md b/docs/docs/case-sensitive.md index 36782ddf3446..3a7102727d51 100644 --- a/docs/docs/case-sensitive.md +++ b/docs/docs/case-sensitive.md @@ -6,9 +6,29 @@ categories: docs nav_order: 4 --- -# Case Sensitivity +# Case and Accent Sensitivity -The spell checker supports case sensitive checking. By default it is turned off. +The spell checker supports case and accent sensitive checking. By default it is turned off for English, but is turned on for some language dictionaries where accents and case are more integral to the language. + +## Accent Checking + +A single setting controls both case and accent checking. The main use case to +turn off case and accent checking is for computer programming. + +When `caseSensitive` is set to false, accents are still checked, but they are allowed to be missing for the entire word. Using the wrong accent or mixing accents is not considered correct. + +Example with `café`: + +| word | | Reason | +| ------ | --- | -------------------------------------------------- | +| `café` | ✓ | Matches the original word | +| `cafe` | ✓ | Accent is missing, ok when case sensitivity is off | +| `cafë` | ❌ | Using a different accent with `e` is not ok | +| `cäfe` | ❌ | Added accent to `a` is not ok | + + + +## Default Setting Because the spell checker was originally case insensitive, making it case aware takes care so as to not break things. CSpell `5.x` introduced the `caseSensitive` setting to allow checking case. @@ -26,6 +46,9 @@ Because the spell checker was originally case insensitive, making it case aware } ``` +**Note:** Some language dictionaries (like German, French, Spanish) turn on case sensitivity by default. Setting the global `"caseSensitive": false` is not sufficient +to turn it off. It is necessary to to use `languageSettings` to turn off case sensitivity based upon the file type. + ## By File Type It can be enabled per file type. @@ -39,6 +62,10 @@ The following configuration will turn on case sensitivity for `markdown` files. { "languageId": "markdown", "caseSensitive": true + }, + { + "languageId": "javascript", + "caseSensitive": false } ] ``` @@ -53,6 +80,16 @@ The following configuration will turn on case sensitivity for `markdown` files. // Case sensitive markdown in the docs folder "filename": "docs/**/*.md", "caseSensitive": true + }, + { + // Make sure TypeScript files are NOT case and accent Sensitive. + "filename": "src/**/*.ts", + "languageSettings": [ + { + "languageId": "*", + "caseSensitive": false + } + ] } ] ```