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
[Bug]: TypeError: Cannot read properties of undefined (reading '0') in cspell-trie-lib #5222
Comments
Thank you! I'll look into it. It should not error like that. |
The error given by The workaround is to have multiple dictionaries:
{
"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"
]
} |
fixes: #5222 The binary dictionary builder (TrieBlob) only supported word lists with 250 unique characters. This was not an issue with the object based trie dictionaries used with the compiled dictionaries.
fixes: #5222 The binary dictionary builder (TrieBlob) only supported word lists with 250 unique characters. This was not an issue with the object based trie dictionaries used with the compiled dictionaries.
fixes: #5222 The binary dictionary builder (TrieBlob) only supported word lists with 250 unique characters. This was not an issue with the object based trie dictionaries used with the compiled dictionaries.
fixes: #5222 The binary dictionary builder (TrieBlob) only supported word lists with 250 unique characters. This was not an issue with the object based trie dictionaries used with the compiled dictionaries.
fixes: #5222 The binary dictionary builder (TrieBlob) only supported word lists with 250 unique characters. This was not an issue with the object based trie dictionaries used with the compiled dictionaries.
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
The text was updated successfully, but these errors were encountered: