Skip to content

EditorSpellcheckFeature

EditorSpellcheckFeature = object

What a host reaches through editor.getFeature(EDITOR_SPELLCHECK_FEATURE).

issueAt(offset): SpellIssue | null

The marked word at offset, edges included; only words on or near the screen are marked.

number

SpellIssue | null


replace(offset, word): boolean

Replaces the marked word at offset as one undoable edit. False when nothing is marked there.

number

string

boolean


setAcceptedWords(words): void

Words never marked, in every editor sharing this editor’s spellcheck service.

readonly string[]

void


suggestions(offset, limit?): Promise<readonly string[]>

Replacements for the marked word at offset, best first; empty when nothing is marked there.

number

number

Promise<readonly string[]>