Module grep_search

Module grep_search 

Source
Expand description

Helper that owns the debounce/cancellation logic for rp_search operations.

This module manages the orchestration of ripgrep searches, implementing debounce and cancellation logic to ensure responsive and efficient searches.

It works as follows:

  1. First query starts a debounce timer.
  2. While the timer is pending, the latest query from the user is stored.
  3. When the timer fires, it is cleared, and a search is done for the most recent query.
  4. If there is an in-flight search that is not a prefix of the latest thing the user typed, it is cancelled.

Structsยง

GrepSearchInput
Input parameters for ripgrep search
GrepSearchManager
State machine for grep_search orchestration.
GrepSearchResult
Result of a ripgrep search