findWords
findWords(
context,editor,filter,pattern,init?,tokensOnly?):Set<string>
Defined in: extensions/autocomplete/utils.ts:63
Utility that searches the editor’s TokenStream for strings. This utility will only search parts of the document whose language has the same completion definition registered.
Parameters
Section titled “Parameters”context
Section titled “context”Current completion context.
editor
Section titled “editor”Editor to search in.
filter
Section titled “filter”(type, start) => boolean
Function used to filter tokens you want to search in. Is called with the type of the token and its starting position. If the filter returns true, the token will be searched.
pattern
Section titled “pattern”RegExp
Pattern used to search for words. Must have the g flag.
Iterable<string, any, any>
Words that should be completed even if they’re not found in the document.
tokensOnly?
Section titled “tokensOnly?”boolean
If true only the text of tokens whose content is a string will be searched. If false, any string inside the TokenStream can be searched.
Returns
Section titled “Returns”Set<string>
A set with found identifers/words.