How to use the cspell-lib.CompoundWordsMethod.NONE function in cspell-lib

To help you get started, we’ve selected a few cspell-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streetsidesoftware / vscode-spell-checker / packages / _server / src / SuggestionsGenerator.ts View on Github external
async genSuggestions(doc: DocInfo, word: string): Promise {
        const { settings, dictionary } = await this.getSettings(doc);
        const { numSuggestions = defaultNumSuggestions } = settings;

        if (word.length > maxWordLengthForSuggestions) {
            return [];
        }
        const numSugs = word.length > wordLengthForLimitingSuggestions ? maxNumberOfSuggestionsForLongWords : numSuggestions;
        const options: SuggestOptions = {
            numChanges: maxEdits,
            numSuggestions: numSugs,
            // Turn off compound suggestions for now until it works a bit better.
            compoundMethod: CompoundWordsMethod.NONE,
            ignoreCase: !settings.caseSensitive,
        };
        return dictionary.suggest(word, options).map(s => ({...s, word: s.word.replace(regexJoinedWords, '')}));
    }