Skip to main content

augment_query_with_scope

Function augment_query_with_scope 

Source
pub fn augment_query_with_scope(
    query: &str,
    relative_scope: &Path,
    is_file_query: bool,
) -> String
Expand description

Augment a query with an implicit path filter when using ancestor index.

§Arguments

  • query - Original query string
  • relative_scope - Path relative to index root to filter by
  • is_file_query - True if scope is a file, false if directory

§Returns

Query string with path filter appended

§Path Handling

  • Paths with spaces, quotes, or glob metacharacters are quoted automatically
  • Inside quotes, glob metacharacters are escaped with backslashes
  • The implicit filter is ANDed with the original query
  • Parentheses ensure correct precedence
  • File queries use exact path match; directory queries use /** glob