Skip to content

Commit

Permalink
fix: Add to Case Sensitive docs (#2432)
Browse files Browse the repository at this point in the history
* fix: Add to Case Sensitive docs

* Update case-sensitive.md
  • Loading branch information
Jason3S authored Feb 11, 2022
1 parent de1d68f commit 5891600
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions docs/docs/case-sensitive.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<!--- cspell:ignore cafë cäfe -->

## 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.

Expand All @@ -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.
Expand All @@ -39,6 +62,10 @@ The following configuration will turn on case sensitivity for `markdown` files.
{
"languageId": "markdown",
"caseSensitive": true
},
{
"languageId": "javascript",
"caseSensitive": false
}
]
```
Expand All @@ -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
}
]
}
]
```

0 comments on commit 5891600

Please sign in to comment.