Skip to content

Commit a0a9719

Browse files
fix: Adjust the layout of the rust dictionary (#5101)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 35393f9 commit a0a9719

File tree

9 files changed

+635
-32
lines changed

9 files changed

+635
-32
lines changed

dictionaries/rust/cspell-ext.json

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,25 @@
1-
// cSpell Settings
21
{
32
"id": "rust",
43
"name": "Rust",
54
"description": "Rust Keyword Dictionary",
65
"readonly": true,
7-
// List of dictionary files to add to the global list of dictionaries
86
"dictionaryDefinitions": [
97
{
108
"name": "rust",
11-
"path": "./dict/rust.txt",
9+
"path": "./dict/rust.txt.gz",
1210
"description": "Rust Keyword Dictionary"
1311
},
1412
{
1513
"name": "rust-crates",
16-
"path": "./dict/crates.txt",
14+
"path": "./dict/crates.txt.gz",
1715
"description": "Common Rust Crates Dictionary"
1816
}
1917
],
20-
// Dictionaries to always be used.
21-
// Generally left empty
22-
"dictionaries": [],
23-
// Language Rules to apply to matching files.
24-
// Files are matched on `languageId` and `locale`
2518
"languageSettings": [
2619
{
27-
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
28-
// * will match against any file type.
2920
"languageId": "rust",
30-
// Language locale. i.e. en-US, de-AT, or ru. * will match all locals.
31-
// Multiple locals can be specified like: "en, en-US" to match both English and English US.
3221
"locale": "*",
33-
// By default the whole text of a file is included for spell checking
34-
// Adding patterns to the "includeRegExpList" to only include matching patterns
35-
"includeRegExpList": [],
36-
// To exclude patterns, add them to "ignoreRegExpList"
37-
"ignoreRegExpList": [],
38-
// regex patterns than can be used with ignoreRegExpList or includeRegExpList
39-
// Example: "pattern": [{ "name": "mdash", "pattern": "&mdash;" }]
40-
// This could be included in "ignoreRegExpList": ["mdash"]
41-
"patterns": [],
42-
// List of dictionaries to enable by name in `dictionaryDefinitions`
43-
"dictionaries": ["rust", "rust-crates"],
44-
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match.
45-
"dictionaryDefinitions": []
22+
"dictionaries": ["rust", "rust-crates"]
4623
}
4724
]
4825
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json
2+
3+
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json
4+
targets:
5+
- name: rust
6+
targetDirectory: ./dict
7+
compress: true
8+
keepUncompressed: true
9+
format: plaintext
10+
sources:
11+
- src/rust.txt
12+
sort: true
13+
- name: crates
14+
targetDirectory: ./dict
15+
compress: true
16+
keepUncompressed: true
17+
format: plaintext
18+
sources:
19+
- src/crates.txt
20+
sort: true
21+
keepRawCase: true

dictionaries/rust/cspell.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"version": "0.2",
33
"dictionaries": [
44
"rust",
5-
"crates"
5+
"rust-crates"
66
],
77
"import": [
88
"./cspell-ext.json"
99
],
1010
"words": [
1111
"Andreev"
1212
]
13-
}
13+
}

dictionaries/rust/dict/crates.txt

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dictionaries/rust/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"./cspell-ext.json": "./cspell-ext.json"
1313
},
1414
"scripts": {
15-
"build": "cspell-tools-cli compile --keep-raw-case src/rust.txt src/crates.txt --no-compress -o ./dict",
16-
"test": "shx head -n 1000 src/rust.txt | cspell -c ./cspell-ext.json --locale=* --languageId=rust stdin",
15+
"build": "cspell-tools-cli build",
16+
"test": "cspell samples",
1717
"prepublishOnly": "echo pre-publish",
1818
"prepare:dictionary": "pnpm run build"
1919
},
@@ -39,8 +39,8 @@
3939
},
4040
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/rust#readme",
4141
"files": [
42-
"dict/rust.txt",
43-
"dict/crates.txt",
42+
"dict/rust.txt.gz",
43+
"dict/crates.txt.gz",
4444
"cspell-ext.json"
4545
]
4646
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"import": ["../cspell-ext.json"]
3+
}

0 commit comments

Comments
 (0)