Skip to content

Commit 1146da2

Browse files
authored
fix: Add btrie path to dictionary definition (#8284)
1 parent 9e844ce commit 1146da2

File tree

6 files changed

+176
-77
lines changed

6 files changed

+176
-77
lines changed

cspell.schema.json

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@
200200
"type": "object"
201201
},
202202
"CustomDictionaryPath": {
203-
"$ref": "#/definitions/FsDictionaryPath",
204-
"description": "A File System Path to a dictionary file.",
205-
"markdownDescription": "A File System Path to a dictionary file."
203+
"description": "A path or url to a custom dictionary file.",
204+
"markdownDescription": "A path or url to a custom dictionary file.",
205+
"type": "string"
206206
},
207207
"CustomDictionaryScope": {
208208
"description": "Specifies the scope of a dictionary.",
@@ -239,7 +239,7 @@
239239
"DictionaryDefinitionAlternate": {
240240
"additionalProperties": false,
241241
"deprecated": true,
242-
"deprecationMessage": "Use {@link DictionaryDefinitionPreferred } instead.",
242+
"deprecationMessage": "Use {@link DictionaryDefinitionPreferred } instead.\nThis will be removed in a future release.",
243243
"description": "Only for legacy dictionary definitions.",
244244
"markdownDescription": "Only for legacy dictionary definitions.",
245245
"properties": {
@@ -304,6 +304,12 @@
304304
"description": "Used to provide extra data related to the dictionary",
305305
"markdownDescription": "Used to provide extra data related to the dictionary",
306306
"properties": {
307+
"btrie": {
308+
"$ref": "#/definitions/DictionaryPathToBTrie",
309+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
310+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
311+
"since": "9.6.0"
312+
},
307313
"description": {
308314
"description": "Optional description of the contents / purpose of the dictionary.",
309315
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
@@ -329,8 +335,8 @@
329335
},
330336
"path": {
331337
"$ref": "#/definitions/DictionaryPath",
332-
"description": "Path to the file.",
333-
"markdownDescription": "Path to the file."
338+
"description": "Path or url to the dictionary file.",
339+
"markdownDescription": "Path or url to the dictionary file."
334340
},
335341
"repMap": {
336342
"$ref": "#/definitions/ReplaceMap",
@@ -371,6 +377,12 @@
371377
"markdownDescription": "When `true`, let's the spell checker know that words can be added to this dictionary.",
372378
"type": "boolean"
373379
},
380+
"btrie": {
381+
"$ref": "#/definitions/DictionaryPathToBTrie",
382+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
383+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
384+
"since": "9.6.0"
385+
},
374386
"description": {
375387
"description": "Optional description of the contents / purpose of the dictionary.",
376388
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
@@ -393,8 +405,8 @@
393405
},
394406
"path": {
395407
"$ref": "#/definitions/CustomDictionaryPath",
396-
"description": "Path to custom dictionary text file.",
397-
"markdownDescription": "Path to custom dictionary text file."
408+
"description": "A file path or url to a custom dictionary file.",
409+
"markdownDescription": "A file path or url to a custom dictionary file."
398410
},
399411
"repMap": {
400412
"$ref": "#/definitions/ReplaceMap",
@@ -695,6 +707,12 @@
695707
"DictionaryDefinitionPreferred": {
696708
"additionalProperties": false,
697709
"properties": {
710+
"btrie": {
711+
"$ref": "#/definitions/DictionaryPathToBTrie",
712+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
713+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
714+
"since": "9.6.0"
715+
},
698716
"description": {
699717
"description": "Optional description of the contents / purpose of the dictionary.",
700718
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
@@ -717,8 +735,8 @@
717735
},
718736
"path": {
719737
"$ref": "#/definitions/DictionaryPath",
720-
"description": "Path to the file.",
721-
"markdownDescription": "Path to the file."
738+
"description": "Path or url to the dictionary file.",
739+
"markdownDescription": "Path or url to the dictionary file."
722740
},
723741
"repMap": {
724742
"$ref": "#/definitions/ReplaceMap",
@@ -870,8 +888,14 @@
870888
"type": "string"
871889
},
872890
"DictionaryPath": {
873-
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:txt|trie|dic)(?:\\.gz)?$`",
874-
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:txt|trie|dic)(?:\\.gz)?$`",
891+
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:txt|trie|btrie|dic)(?:\\.gz)?$`",
892+
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:txt|trie|btrie|dic)(?:\\.gz)?$`",
893+
"type": "string"
894+
},
895+
"DictionaryPathToBTrie": {
896+
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:btrie)(?:\\.gz)?$`",
897+
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:btrie)(?:\\.gz)?$`",
898+
"since": "9.6.0",
875899
"type": "string"
876900
},
877901
"DictionaryRef": {
@@ -948,11 +972,6 @@
948972
},
949973
"type": "object"
950974
},
951-
"FsDictionaryPath": {
952-
"description": "A File System Path. Relative paths are relative to the configuration file.",
953-
"markdownDescription": "A File System Path. Relative paths are relative to the configuration file.",
954-
"type": "string"
955-
},
956975
"FsPath": {
957976
"description": "A File System Path. Relative paths are relative to the configuration file.",
958977
"markdownDescription": "A File System Path. Relative paths are relative to the configuration file.",

packages/cspell-eslint-plugin/src/generated/schema.cts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ export const optionsSchema: Rule.RuleMetaData['schema'] = {
127127
"type": "string"
128128
},
129129
"path": {
130-
"description": "Path to the file.",
131-
"markdownDescription": "Path to the file.",
130+
"description": "Path or url to the dictionary file.",
131+
"markdownDescription": "Path or url to the dictionary file.",
132132
"type": "string"
133133
},
134134
"supportNonStrictSearches": {

packages/cspell-lib/api/api.d.ts

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

packages/cspell-lib/src/lib/Settings/DictionarySettings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ class _DictionaryDefinitionInternalWithSource implements DictionaryFileDefinitio
199199
name,
200200
file: undefined,
201201
path: resolvedPath,
202+
btrie: undefined,
202203
addWords,
203204
description,
204205
dictionaryInformation,

packages/cspell-types/cspell.schema.json

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@
200200
"type": "object"
201201
},
202202
"CustomDictionaryPath": {
203-
"$ref": "#/definitions/FsDictionaryPath",
204-
"description": "A File System Path to a dictionary file.",
205-
"markdownDescription": "A File System Path to a dictionary file."
203+
"description": "A path or url to a custom dictionary file.",
204+
"markdownDescription": "A path or url to a custom dictionary file.",
205+
"type": "string"
206206
},
207207
"CustomDictionaryScope": {
208208
"description": "Specifies the scope of a dictionary.",
@@ -239,7 +239,7 @@
239239
"DictionaryDefinitionAlternate": {
240240
"additionalProperties": false,
241241
"deprecated": true,
242-
"deprecationMessage": "Use {@link DictionaryDefinitionPreferred } instead.",
242+
"deprecationMessage": "Use {@link DictionaryDefinitionPreferred } instead.\nThis will be removed in a future release.",
243243
"description": "Only for legacy dictionary definitions.",
244244
"markdownDescription": "Only for legacy dictionary definitions.",
245245
"properties": {
@@ -304,6 +304,12 @@
304304
"description": "Used to provide extra data related to the dictionary",
305305
"markdownDescription": "Used to provide extra data related to the dictionary",
306306
"properties": {
307+
"btrie": {
308+
"$ref": "#/definitions/DictionaryPathToBTrie",
309+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
310+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
311+
"since": "9.6.0"
312+
},
307313
"description": {
308314
"description": "Optional description of the contents / purpose of the dictionary.",
309315
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
@@ -329,8 +335,8 @@
329335
},
330336
"path": {
331337
"$ref": "#/definitions/DictionaryPath",
332-
"description": "Path to the file.",
333-
"markdownDescription": "Path to the file."
338+
"description": "Path or url to the dictionary file.",
339+
"markdownDescription": "Path or url to the dictionary file."
334340
},
335341
"repMap": {
336342
"$ref": "#/definitions/ReplaceMap",
@@ -371,6 +377,12 @@
371377
"markdownDescription": "When `true`, let's the spell checker know that words can be added to this dictionary.",
372378
"type": "boolean"
373379
},
380+
"btrie": {
381+
"$ref": "#/definitions/DictionaryPathToBTrie",
382+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
383+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
384+
"since": "9.6.0"
385+
},
374386
"description": {
375387
"description": "Optional description of the contents / purpose of the dictionary.",
376388
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
@@ -393,8 +405,8 @@
393405
},
394406
"path": {
395407
"$ref": "#/definitions/CustomDictionaryPath",
396-
"description": "Path to custom dictionary text file.",
397-
"markdownDescription": "Path to custom dictionary text file."
408+
"description": "A file path or url to a custom dictionary file.",
409+
"markdownDescription": "A file path or url to a custom dictionary file."
398410
},
399411
"repMap": {
400412
"$ref": "#/definitions/ReplaceMap",
@@ -695,6 +707,12 @@
695707
"DictionaryDefinitionPreferred": {
696708
"additionalProperties": false,
697709
"properties": {
710+
"btrie": {
711+
"$ref": "#/definitions/DictionaryPathToBTrie",
712+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
713+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
714+
"since": "9.6.0"
715+
},
698716
"description": {
699717
"description": "Optional description of the contents / purpose of the dictionary.",
700718
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
@@ -717,8 +735,8 @@
717735
},
718736
"path": {
719737
"$ref": "#/definitions/DictionaryPath",
720-
"description": "Path to the file.",
721-
"markdownDescription": "Path to the file."
738+
"description": "Path or url to the dictionary file.",
739+
"markdownDescription": "Path or url to the dictionary file."
722740
},
723741
"repMap": {
724742
"$ref": "#/definitions/ReplaceMap",
@@ -870,8 +888,14 @@
870888
"type": "string"
871889
},
872890
"DictionaryPath": {
873-
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:txt|trie|dic)(?:\\.gz)?$`",
874-
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:txt|trie|dic)(?:\\.gz)?$`",
891+
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:txt|trie|btrie|dic)(?:\\.gz)?$`",
892+
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:txt|trie|btrie|dic)(?:\\.gz)?$`",
893+
"type": "string"
894+
},
895+
"DictionaryPathToBTrie": {
896+
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:btrie)(?:\\.gz)?$`",
897+
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:btrie)(?:\\.gz)?$`",
898+
"since": "9.6.0",
875899
"type": "string"
876900
},
877901
"DictionaryRef": {
@@ -948,11 +972,6 @@
948972
},
949973
"type": "object"
950974
},
951-
"FsDictionaryPath": {
952-
"description": "A File System Path. Relative paths are relative to the configuration file.",
953-
"markdownDescription": "A File System Path. Relative paths are relative to the configuration file.",
954-
"type": "string"
955-
},
956975
"FsPath": {
957976
"description": "A File System Path. Relative paths are relative to the configuration file.",
958977
"markdownDescription": "A File System Path. Relative paths are relative to the configuration file.",

0 commit comments

Comments
 (0)