Skip to content

SpellcheckService

One dictionary worker, shared by every editor on the page. The host creates it once and hands it to each editor’s spellcheck; the worker starts on the first request.

new SpellcheckService(options?): SpellcheckService

SpellcheckServiceOptions

SpellcheckService

check(words): Promise<readonly string[]>

The words among words that are misspelled.

readonly string[]

Promise<readonly string[]>


dispose(): void

void


isAccepted(word): boolean

Answered here, so a verdict the worker gave before the word was accepted never needs asking again.

string

boolean


onDidChangeAcceptedWords(listener): object

() => void

object

dispose(): void

void


setAcceptedWords(words): void

Replaces the accepted list for every editor sharing the service; it survives a worker restart.

readonly string[]

void


suggest(word, limit?): Promise<readonly string[]>

string

number

Promise<readonly string[]>