Closed 1j01 closed 5 months ago
@1j01,
Thank you! I'll look into it. It should not error like that.
@1j01,
The error given by cspell
is not very informative. The spell checker failed to create an internal dictionary based upon the words found in the config. There is a limit on the number of unique characters in a dictionary. I'll look into a fix to make the limit much larger, but it might take a while.
The workaround is to have multiple dictionaries:
cspell.json
{
"dictionaryDefinitions": [
{
"name": "words-latin",
"path": "words-latin.txt"
},
{
"name": "words-greek",
"path": "words-greek.txt"
},
{
"name": "words-cyrillic",
"path": "words-cyrillic.txt"
},
{
"name": "words-arabic",
"path": "words-arabic.txt"
},
{
"name": "words-inline",
"words": [
"DIALOGEX",
"GIFs",
"WINTRAP"
]
}
],
"dictionaries": [
"words-latin",
"words-greek",
"words-cyrillic",
"words-arabic",
"words-inline"
]
}
I'm re-opening this issue since I had to revert the changes in #5233 with #5281.
The fix has been in for a while. Closing.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Kind of Issue
Crash / Error
Tool or Library
cspell-trie
Version
8.3.2
Supporting Library
cspell-trie-lib
OS
All of them
OS Version
No response
Description
With a multi-lingual word list, the CSpell CLI throws an error while constructing a prefix tree from the dictionary. See this repro repo for more info.
Steps to Reproduce
cspell-cli lint .
with the given configuration file, and it throws an error.cspell.json
file in VS Code, and it reports a misspelling for one of the words in the accepted words list. Before trimming the word list, it reported even more words within the word list as misspelled.Expected Behavior
cspell-cli lint .
should not error.words
array incspell.json
should be underlined in VS Code.Additional Information
There is likely a much smaller reproduction possible, but in the given configuration, removing any one word will make it fail to reproduce the bug. I have not tried simplifying the reproduction by modifying the words themselves, although this may be elucidatory.
cspell.json
cspell.config.yaml
No response
Example Repository
https://github.com/1j01/cspell-bug-repro
Code of Conduct