Skip to main content

Module content_search

Module content_search 

Source
Expand description

Native content search over a workspace tree.

This replaces the external ripgrep binary that VT Code used to download and spawn. The engine walks the tree with the ignore crate (so .gitignore, .ignore, .git/exclude, and .vtcodegitignore keep applying), then scans each file’s bytes with the regex crate.

Two matching modes exist, mirroring ripgrep’s:

  • Literal: the pattern is escaped and matched verbatim, so regex metacharacters in the pattern carry no meaning.
  • Regex: the pattern is compiled as a regular expression.

Matching is line-oriented: a match is reported with the line that contains it, the byte column of the match within that line, and the file-absolute byte offsets of the match and of the line it sits on. That keeps the result shape identical to ripgrep’s --json stream, which the tool layer still consumes.

Structs§

LineMatch
A single matching line within a file.
SearchRequest
Configuration for a content search.

Enums§

CaseSensitivity
Whether matching is case-sensitive.
MatchMode
How the search pattern should be interpreted.
SearchError
Errors that can occur while running a content search.

Functions§

search
Runs request against the tree and returns the matching lines.