Skip to content

Commit

Permalink
Add some more information to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Apr 28, 2018
1 parent e0ceab6 commit c6608eb
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,57 @@ The spell checker includes a set of default dictionaries.

## LanguageSettings

* todo
The Language Settings allow configuration to be based upon the programming langauge and/or the local.
There are two selector fields `local` and `languageId`.

* `languageId` defines which programming languages to match against.
A value of `"python,javascript"` will match against *python* and *javascript* files. To match against ALL programming languages,
use `"*"`.
* `local` defines which spoken langauges to match against. A value of `"en-GB,nl"` will match against British English or Dutch.
A value of `"*"` will match all spoken languages.
* Most configuration values allowed in a `cspell.json` file can be define or redefine within the `languageSettings`.

```javascript
"languageSettings": [
{
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
// * will match against any file type.
"languageId": "c,cpp",
// Language local. i.e. en-US, de-AT, or ru. * will match all locals.
// Multiple locals can be specified like: "en, en-US" to match both English and English US.
"local": "*",
// To exclude patterns, add them to "ignoreRegExpList"
"ignoreRegExpList": [
"/#include.*/"
],
// List of dictionaries to enable by name in `dictionaryDefinitions`
"dictionaries": ["cpp"],
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "local" match.
"dictionaryDefinitions": []
}
]
```

## Overrides

Overrides are useful for forcing configuration on a per file basis.

Example:
```javascript
"overrides": [
// Force `*.hrr` and `*.crr` files to be treated as `cpp` files:
{
"filename": "**/{*.hrr,*.crr}",
"languageId": "cpp"
},
// Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
{
"language": "nl",
"filename": "**/dutch/**/*.txt"
}
]
```


<!---
These are at the bottom because the VSCode Marketplace leaves a bit space at the top
Expand All @@ -384,3 +434,4 @@ The spell checker includes a set of default dictionaries.
cSpell:ignore mkdirp githubusercontent streetsidesoftware vsmarketplacebadge visualstudio
cSpell:words Verdana
-->

24 changes: 24 additions & 0 deletions samples/.cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,29 @@
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "local" match.
"dictionaryDefinitions": []
}
],

"overrides": [
{
"filename": "**/{*.py}",
"ignoreRegExpList": ["/'s\\b/"]
},
{
"language": "nl",
"filename": "**/{*.c,*.cpp}",
"ignoreRegExpList": ["/'s\\b/"],
"dictionaryDefinitions": [
{
"name": "cpp",
"path": "../dictionaries/companies.txt",
"description": "C/C++ Keywords and common library functions."
}
]
},
// Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
{
"language": "nl",
"filename": "**/dutch/*.txt"
}
]
}

0 comments on commit c6608eb

Please sign in to comment.