• Utility that searches the editor's TokenStream for strings.

    Parameters

    • context: CompletionContext

      Current completion context.

    • editor: PrismEditor

      Editor to search in.

    • 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.

        • (type, start): boolean
        • Parameters

          • type: string
          • start: number

          Returns boolean

    • pattern: RegExp

      Pattern used to search for words.

    • Optional init: Iterable<string>

      Words to initialize the result with.

    • Optional tokensOnly: boolean

      If true only the text of tokens whoose content is a string will be searched. If not any string inside the TokenStream can be searched.

    Returns string[]

    An array with found identifers/words.

Generated using TypeDoc