Skip to main content

Module query

Module query 

Source
Expand description

Query module for symbol, reference, and call search operations.

This module provides the core search functionality for llmgrep, including:

  • Symbol search with fuzzy matching and filtering
  • Reference search (find incoming edges to symbols)
  • Call search (find outgoing function calls from symbols)
  • AST-based filtering by node kind
  • Metrics-based filtering (complexity, fan-in, fan-out)
  • Algorithm-based filtering (reachable, dead-code, cycles, etc.)

§Search Options

All search operations use SearchOptions to configure the query. See the SearchOptions struct documentation for all available options.

§Language Inference

The infer_language function detects programming language from file extensions, used for labeling symbols with their source language.

Structs§

AstOptions
AST-based filtering options
CodeChunk
Code chunk from Magellan’s code_chunks table.
ContextOptions
Context extraction options
DepthOptions
Depth-based filtering options
FqnOptions
FQN inclusion options (symbols only)
MetricsOptions
Metrics-based filtering options
SearchOptions
Options for all search functions
SnippetOptions
Snippet extraction options

Enums§

BackendFormat
Database backend format detection
CoverageFilter
Coverage filter for symbol search.

Functions§

detect_backend_format
Detect the backend format of a database file by checking magic bytes
infer_language
Infer programming language from file extension
search_calls
Public wrapper for search_calls that handles connection opening and validation.
search_chunks_by_span
Query the code_chunks table by span
search_chunks_by_symbol_name
Query the code_chunks table by symbol name
search_references
Public wrapper for search_references that handles connection opening and validation.
search_symbols
Public wrapper for search_symbols that handles connection opening and validation.