Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add to Case Sensitive docs #2432

Merged
merged 2 commits into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
]
}
]
```