Class EditorSearchProvider<T>Abstract

Search provider for editors.

Type Parameters


  • EditorSearchProvider




    _cmHandler: null | CodeMirrorSearchHighlighter = null
    _inSelection: null | IRange = null
    _isActive: boolean = true
    _isDisposed: boolean = false
    _stateChanged: Signal<IBaseSearchProvider, void>
    currentIndex: null | number = null

    Current match index

    filters: undefined | IFilters

    Current search filters

    query: null | RegExp = null

    Current search query



    • Replace the currently selected match with the provided text.

      If no match is selected, it won't do anything.

      The caller of this method is expected to call highlightNext if after calling replaceCurrentMatch() attribute this.currentIndex is null. It is necessary to let the caller handle highlighting because this method is used in composition pattern (search engine of notebook cells) and highlighting on the composer (notebook) level needs to switch to next engine (cell) with matches.


      • newText: string

        The replacement text.

      • Optional loop: boolean
      • Optional options: IReplaceOptions

      Returns Promise<boolean>

      Whether a replace occurred.

    • Set whether user selection should be protected from modifications.

      If disabled, the selection will be updated on search and on editor focus to cover the current match. We need to protect selection from modifications for both: search in text and search in cells; since setSearchSelection is only telling us about search in text, we need to have an additional way to signal that either search in text or in cells is active, or for any other reason selection range should be protected.


      • v: boolean

      Returns void