1,429 matches across 22 files for func main lang:Rust lang:Rust
snippet_mode: grep · sorted by relevance
compiler/crates/react_compiler/src/entrypoint/compile_result.rs RUST 11 matches · showing 5 view file →
4use react_compiler_ast::statements::BlockStatement;
5use react_compiler_diagnostics::SourceLocation;
6use react_compiler_hir::ReactFunctionType;
7use serde::Serialize;
8
· · ·
81}
82
83/// Main result type returned by the compile function.
84/// Serialized to JSON and returned to the JS shim.
85#[derive(Debug, Serialize)]
· · ·
86#[serde(tag = "kind", rename_all = "lowercase")]
87pub enum CompileResult {
88 /// Compilation succeeded (or no functions needed compilation).
89 /// `ast` is None if no changes were made to the program.
90 /// The compiled Babel AST is returned by value so in-process Rust consumers
· · ·
218}
219
220/// Codegen output for a single compiled function.
221/// Carries the generated AST fields needed to replace the original function.
222#[derive(Debug, Clone)]
· · ·
221/// Carries the generated AST fields needed to replace the original function.
222#[derive(Debug, Clone)]
223pub struct CodegenFunction {
+ 6 more matches in this file
compiler/crates/react_compiler/src/entrypoint/gating.rs RUST 107 matches · showing 5 view file →
1// Gating rewrite logic for compiled functions.
2//
3// When gating is enabled, the compiled function is wrapped in a conditional:
· · ·
3// When gating is enabled, the compiled function is wrapped in a conditional:
4// `gating() ? optimized_fn : original_fn`
5//
· · ·
6// For function declarations referenced before their declaration, a special
7// hoisting pattern is used (see `insert_additional_function_declaration`).
8//
· · ·
7// hoisting pattern is used (see `insert_additional_function_declaration`).
8//
9// Ported from `Entrypoint/Gating.ts`.
· · ·
19use super::plugin_options::GatingConfig;
20
21/// A compiled function node, can be any function type.
22#[derive(Debug, Clone)]
23pub enum CompiledFunctionNode {
+ 102 more matches in this file
compiler/crates/react_compiler/src/entrypoint/program.rs RUST 378 matches · showing 5 view file →
4// LICENSE file in the root directory of this source tree.
5
6//! Main entrypoint for the React Compiler.
7//!
8//! This module is a port of Program.ts from the TypeScript compiler. It orchestrates
· · ·
11//! 2. Validating restricted imports
12//! 3. Finding program-level suppressions
13//! 4. Discovering functions to compile (components, hooks)
14//! 5. Processing each function through the compilation pipeline
15//! 6. Applying compiled functions back to the AST
· · ·
14//! 5. Processing each function through the compilation pipeline
15//! 6. Applying compiled functions back to the AST
16
· · ·
15//! 6. Applying compiled functions back to the AST
16
17use rustc_hash::{FxHashMap, FxHashSet};
· · ·
40use react_compiler_diagnostics::ErrorCategory;
41use react_compiler_diagnostics::SourceLocation;
42use react_compiler_hir::ReactFunctionType;
43use react_compiler_hir::environment_config::EnvironmentConfig;
44use react_compiler_lowering::FunctionNode;
+ 373 more matches in this file
compiler/crates/react_compiler_diagnostics/src/lib.rs RUST 3 matches view file →
245
246/// Aggregate compiler error - can contain multiple diagnostics.
247/// This is the main error type thrown/returned by the compiler.
248#[derive(Debug, Clone)]
249pub struct CompilerError {
· · ·
380
381/// Allow `?` to convert a `CompilerError` into a `CompilerDiagnostic`
382/// when the enclosing function returns `Result<T, CompilerDiagnostic>`.
383///
384/// This typically happens when `record_error()` returns `Err(CompilerError)`
· · ·
385/// for an Invariant error, and the calling function already returns
386/// `Result<T, CompilerDiagnostic>`. The conversion extracts the first
387/// error detail from the aggregate error.
compiler/crates/react_compiler_hir/src/environment.rs RUST 60 matches · showing 5 view file →
12use crate::globals::{self};
13use crate::object_shape::BUILT_IN_MIXED_READONLY_ID;
14use crate::object_shape::FunctionSignature;
15use crate::object_shape::HookKind;
16use crate::object_shape::HookSignatureBuilder;
· · ·
49 pub types: Vec<Type>,
50 pub scopes: Vec<ReactiveScope>,
51 pub functions: Vec<HirFunction>,
52
53 // Error accumulation
· · ·
54 pub errors: CompilerError,
55
56 // Function type classification (Component, Hook, Other)
57 pub fn_type: ReactFunctionType,
58
· · ·
57 pub fn_type: ReactFunctionType,
58
59 // Output mode (Client, Ssr, Lint)
· · ·
105 default_mutating_hook: Option<Global>,
106
107 // Outlined functions: functions extracted from the component during outlining passes
108 outlined_functions: Vec<OutlinedFunctionEntry>,
109
+ 55 more matches in this file
compiler/crates/react_compiler_inference/src/build_reactive_scope_terminals_hir.rs RUST 24 matches · showing 5 view file →
6//! Builds reactive scope terminals in the HIR.
7//!
8//! Given a function whose reactive scope ranges have been correctly aligned and
9//! merged, this pass rewrites blocks to introduce ReactiveScopeTerminals and
10//! their fallthrough blocks.
· · ·
19use react_compiler_hir::EvaluationOrder;
20use react_compiler_hir::GotoVariant;
21use react_compiler_hir::HirFunction;
22use react_compiler_hir::IdentifierId;
23use react_compiler_hir::ScopeId;
· · ·
35// =============================================================================
36
37/// Collect all unique scopes from places in the function that have non-empty ranges.
38/// Corresponds to TS `getScopes(fn)`.
39fn get_scopes(func: &HirFunction, env: &Environment) -> Vec<ScopeId> {
· · ·
39fn get_scopes(func: &HirFunction, env: &Environment) -> Vec<ScopeId> {
40 let mut scope_ids: FxHashSet<ScopeId> = FxHashSet::default();
41
· · ·
49 };
50
51 for (_block_id, block) in &func.body.blocks {
52 for &instr_id in &block.instructions {
53 let instr = &func.instructions[instr_id.0 as usize];
+ 19 more matches in this file
compiler/crates/react_compiler_inference/src/infer_reactive_places.rs RUST 82 matches · showing 5 view file →
23use react_compiler_hir::visitors;
24use react_compiler_hir::{
25 BlockId, Effect, FunctionId, HirFunction, IdentifierId, InstructionValue, ParamPattern,
26 Terminal, Type,
27};
· · ·
35// =============================================================================
36
37/// Infer which places in a function are reactive.
38///
39/// Corresponds to TS `inferReactivePlaces(fn: HIRFunction): void`.
· · ·
39/// Corresponds to TS `inferReactivePlaces(fn: HIRFunction): void`.
40pub fn infer_reactive_places(
41 func: &mut HirFunction,
· · ·
41 func: &mut HirFunction,
42 env: &mut Environment,
43) -> Result<(), CompilerDiagnostic> {
· · ·
44 let mut aliased_identifiers = find_disjoint_mutable_values(func, env);
45 let mut reactive_map = ReactivityMap::new(&mut aliased_identifiers);
46 let mut stable_sidemap = StableSidemap::new();
+ 77 more matches in this file
compiler/crates/react_compiler_inference/src/memoize_fbt_and_macro_operands_in_same_scope.rs RUST 14 matches · showing 5 view file →
19use react_compiler_hir::visitors;
20use react_compiler_hir::{
21 HirFunction, IdentifierId, InstructionValue, JsxTag, PrimitiveValue, PropertyLiteral, ScopeId,
22};
23
· · ·
95}
96
97/// Main entry point. Returns the set of identifier IDs that are fbt/macro operands.
98pub fn memoize_fbt_and_macro_operands_in_same_scope(
99 func: &HirFunction,
· · ·
99 func: &HirFunction,
100 env: &mut Environment,
101) -> FxHashSet<IdentifierId> {
· · ·
109
110 // Phase 2: Forward data-flow to identify all macro tags
111 let mut macro_tags = populate_macro_tags(func, &macro_kinds);
112
113 // Phase 3: Reverse data-flow to merge arguments of macro invocations
· · ·
114 let macro_values = merge_macro_arguments(func, env, &mut macro_tags, &macro_kinds);
115
116 macro_values
+ 9 more matches in this file
compiler/crates/react_compiler_inference/src/propagate_scope_dependencies_hir.rs RUST 153 matches · showing 5 view file →
20use react_compiler_hir::visitors::{ScopeBlockInfo, ScopeBlockTraversal};
21use react_compiler_hir::{
22 BasicBlock, BlockId, DeclarationId, DependencyPathEntry, EvaluationOrder, FunctionId,
23 GotoVariant, HirFunction, IdentifierId, Instruction, InstructionId, InstructionKind,
24 InstructionValue, MutableRange, ParamPattern, Place, PlaceOrSpread, PropertyLiteral,
· · ·
23 GotoVariant, HirFunction, IdentifierId, Instruction, InstructionId, InstructionKind,
24 InstructionValue, MutableRange, ParamPattern, Place, PlaceOrSpread, PropertyLiteral,
25 ReactFunctionType, ReactiveScopeDependency, ScopeId, Terminal, Type, visitors,
· · ·
25 ReactFunctionType, ReactiveScopeDependency, ScopeId, Terminal, Type, visitors,
26};
27
· · ·
30// =============================================================================
31
32/// Main entry point: propagate scope dependencies through the HIR.
33/// Corresponds to TS `propagateScopeDependenciesHIR(fn)`.
34pub fn propagate_scope_dependencies_hir(func: &mut HirFunction, env: &mut Environment) {
· · ·
34pub fn propagate_scope_dependencies_hir(func: &mut HirFunction, env: &mut Environment) {
35 let used_outside_declaring_scope = find_temporaries_used_outside_declaring_scope(func, env);
36 let temporaries = collect_temporaries_sidemap(func, env, &used_outside_declaring_scope);
+ 148 more matches in this file
compiler/crates/react_compiler_lowering/src/build_hir.rs RUST 246 matches · showing 5 view file →
15use react_compiler_hir::*;
16
17use crate::FunctionNode;
18use crate::find_context_identifiers::find_context_identifiers;
19use crate::hir_builder::HirBuilder;
· · ·
113 Expression::AssignmentExpression(e) => e.base.loc.clone(),
114 Expression::SequenceExpression(e) => e.base.loc.clone(),
115 Expression::ArrowFunctionExpression(e) => e.base.loc.clone(),
116 Expression::FunctionExpression(e) => e.base.loc.clone(),
117 Expression::ObjectExpression(e) => e.base.loc.clone(),
· · ·
116 Expression::FunctionExpression(e) => e.base.loc.clone(),
117 Expression::ObjectExpression(e) => e.base.loc.clone(),
118 Expression::ArrayExpression(e) => e.base.loc.clone(),
· · ·
145fn validate_ts_this_parameter(
146 scope_info: &ScopeInfo,
147 function_scope: ScopeId,
148) -> Result<(), CompilerError> {
149 let Some(scope) = scope_info.scopes.get(function_scope.0 as usize) else {
· · ·
149 let Some(scope) = scope_info.scopes.get(function_scope.0 as usize) else {
150 return Ok(());
151 };
+ 241 more matches in this file
compiler/crates/react_compiler_lowering/src/lib.rs RUST 16 matches · showing 5 view file →
4pub mod identifier_loc_index;
5
6use react_compiler_ast::expressions::ArrowFunctionExpression;
7use react_compiler_ast::expressions::FunctionExpression;
8use react_compiler_ast::statements::FunctionDeclaration;
· · ·
7use react_compiler_ast::expressions::FunctionExpression;
8use react_compiler_ast::statements::FunctionDeclaration;
9use react_compiler_hir::BindingKind;
· · ·
8use react_compiler_ast::statements::FunctionDeclaration;
9use react_compiler_hir::BindingKind;
10
· · ·
23}
24
25/// Represents a reference to a function AST node for lowering.
26/// Analogous to TS's `NodePath<t.Function>` / `BabelFn`.
27pub enum FunctionNode<'a> {
· · ·
26/// Analogous to TS's `NodePath<t.Function>` / `BabelFn`.
27pub enum FunctionNode<'a> {
28 FunctionDeclaration(&'a FunctionDeclaration),
+ 11 more matches in this file
compiler/crates/react_compiler_optimization/src/drop_manual_memoization.rs RUST 42 matches · showing 5 view file →
22use react_compiler_hir::Effect;
23use react_compiler_hir::EvaluationOrder;
24use react_compiler_hir::HirFunction;
25use react_compiler_hir::IdentifierId;
26use react_compiler_hir::IdentifierName;
· · ·
57
58struct IdentifierSidemap {
59 /// Maps identifier id -> InstructionId of FunctionExpression instructions
60 functions: FxHashSet<IdentifierId>,
61 /// Maps identifier id -> ManualMemoCallee for useMemo/useCallback callees
· · ·
60 functions: FxHashSet<IdentifierId>,
61 /// Maps identifier id -> ManualMemoCallee for useMemo/useCallback callees
62 manual_memos: FxHashMap<IdentifierId, ManualMemoCallee>,
· · ·
84
85// =============================================================================
86// Main pass
87// =============================================================================
88
· · ·
90/// with direct invocations/references.
91pub fn drop_manual_memoization(
92 func: &mut HirFunction,
93 env: &mut Environment,
94) -> Result<(), CompilerDiagnostic> {
+ 37 more matches in this file
compiler/crates/react_compiler_optimization/src/outline_functions.rs RUST 52 matches · showing 5 view file →
4// LICENSE file in the root directory of this source tree.
5
6//! Port of OutlineFunctions from TypeScript (`Optimization/OutlineFunctions.ts`).
7//!
8//! Extracts anonymous function expressions that do not close over any local
· · ·
8//! Extracts anonymous function expressions that do not close over any local
9//! variables into top-level outlined functions. The original instruction is
10//! replaced with a `LoadGlobal` referencing the outlined function's generated name.
· · ·
9//! variables into top-level outlined functions. The original instruction is
10//! replaced with a `LoadGlobal` referencing the outlined function's generated name.
11//!
· · ·
10//! replaced with a `LoadGlobal` referencing the outlined function's generated name.
11//!
12//! Conditional on `env.config.enable_function_outlining`.
· · ·
12//! Conditional on `env.config.enable_function_outlining`.
13
14use rustc_hash::FxHashSet;
+ 47 more matches in this file
compiler/crates/react_compiler_optimization/src/outline_jsx.rs RUST 62 matches · showing 5 view file →
6//! Port of OutlineJsx from TypeScript.
7//!
8//! Outlines JSX expressions in callbacks into separate component functions.
9//! This pass is conditional on `env.config.enable_jsx_outlining` (defaults to false).
10
· · ·
14use react_compiler_hir::environment::Environment;
15use react_compiler_hir::{
16 BasicBlock, BlockId, BlockKind, EvaluationOrder, FunctionId, HIR, HirFunction, IdentifierId,
17 IdentifierName, Instruction, InstructionId, InstructionKind, InstructionValue, JsxAttribute,
18 JsxTag, LValuePattern, NonLocalBinding, ObjectPattern, ObjectProperty, ObjectPropertyKey,
· · ·
19 ObjectPropertyOrSpread, ObjectPropertyType, ParamPattern, Pattern, Place, ReactFunctionType,
20 ReturnVariant, Terminal,
21};
· · ·
22
23/// Outline JSX expressions in inner functions into separate outlined components.
24///
25/// Ported from TS `outlineJSX` in `Optimization/OutlineJsx.ts`.
· · ·
26pub fn outline_jsx(func: &mut HirFunction, env: &mut Environment) {
27 let mut outlined_fns: Vec<HirFunction> = Vec::new();
28 outline_jsx_impl(func, env, &mut outlined_fns);
+ 57 more matches in this file
compiler/crates/react_compiler_reactive_scopes/src/build_reactive_function.rs RUST 15 matches · showing 5 view file →
4// LICENSE file in the root directory of this source tree.
5
6//! Converts the HIR CFG into a tree-structured ReactiveFunction.
7//!
8//! Corresponds to `src/ReactiveScopes/BuildReactiveFunction.ts`.
· · ·
8//! Corresponds to `src/ReactiveScopes/BuildReactiveFunction.ts`.
9
10use rustc_hash::FxHashSet;
· · ·
15use react_compiler_hir::environment::Environment;
16use react_compiler_hir::{
17 BasicBlock, BlockId, EvaluationOrder, GotoVariant, HirFunction, InstructionValue, Place,
18 PrunedReactiveScopeBlock, ReactiveBlock, ReactiveFunction, ReactiveInstruction, ReactiveLabel,
19 ReactiveScopeBlock, ReactiveStatement, ReactiveSwitchCase, ReactiveTerminal,
· · ·
18 PrunedReactiveScopeBlock, ReactiveBlock, ReactiveFunction, ReactiveInstruction, ReactiveLabel,
19 ReactiveScopeBlock, ReactiveStatement, ReactiveSwitchCase, ReactiveTerminal,
20 ReactiveTerminalStatement, ReactiveTerminalTargetKind, ReactiveValue, Terminal,
· · ·
21};
22
23/// Convert the HIR CFG into a tree-structured ReactiveFunction.
24pub fn build_reactive_function(
25 hir: &HirFunction,
+ 10 more matches in this file
compiler/crates/react_compiler_reactive_scopes/src/merge_reactive_scopes_that_invalidate_together.rs RUST 16 matches · showing 5 view file →
14use react_compiler_hir::{
15 DeclarationId, DependencyPathEntry, EvaluationOrder, InstructionKind, InstructionValue, Place,
16 ReactiveBlock, ReactiveFunction, ReactiveScopeBlock, ReactiveScopeDependency,
17 ReactiveStatement, ReactiveValue, ScopeId, Type,
18 environment::Environment,
· · ·
19 object_shape::{BUILT_IN_ARRAY_ID, BUILT_IN_FUNCTION_ID, BUILT_IN_JSX_ID, BUILT_IN_OBJECT_ID},
20};
21
· · ·
22use crate::visitors::{
23 ReactiveFunctionTransform, ReactiveFunctionVisitor, Transformed, transform_reactive_function,
24 visit_reactive_function,
25};
· · ·
24 visit_reactive_function,
25};
26
· · ·
32/// TS: `mergeReactiveScopesThatInvalidateTogether`
33pub fn merge_reactive_scopes_that_invalidate_together(
34 func: &mut ReactiveFunction,
35 env: &mut Environment,
36) -> Result<(), CompilerError> {
+ 11 more matches in this file
compiler/crates/react_compiler_reactive_scopes/src/prune_non_reactive_dependencies.rs RUST 15 matches · showing 5 view file →
13use react_compiler_hir::{
14 EvaluationOrder, IdentifierId, InstructionValue, Place, PrunedReactiveScopeBlock,
15 ReactiveFunction, ReactiveInstruction, ReactiveScopeBlock, ReactiveValue,
16 environment::Environment, is_primitive_type, is_use_ref_type, object_shape,
17 visitors as hir_visitors,
· · ·
18};
19
20use crate::visitors::{self, ReactiveFunctionTransform, ReactiveFunctionVisitor};
21
22// =============================================================================
· · ·
27/// TS: `collectReactiveIdentifiers`
28pub fn collect_reactive_identifiers(
29 func: &ReactiveFunction,
30 env: &Environment,
31) -> FxHashSet<IdentifierId> {
· · ·
32 let visitor = CollectVisitor { env };
33 let mut state = FxHashSet::default();
34 crate::visitors::visit_reactive_function(func, &visitor, &mut state);
35 state
36}
· · ·
40}
41
42impl<'a> ReactiveFunctionVisitor for CollectVisitor<'a> {
43 type State = FxHashSet<IdentifierId>;
44
+ 10 more matches in this file
compiler/crates/react_compiler_reactive_scopes/src/prune_unused_lvalues.rs RUST 12 matches · showing 5 view file →
13
14use react_compiler_hir::{
15 DeclarationId, EvaluationOrder, Place, ReactiveFunction, ReactiveInstruction,
16 ReactiveStatement, ReactiveValue, environment::Environment,
17};
· · ·
18
19use crate::visitors::{self, ReactiveFunctionVisitor};
20
21/// Nulls out lvalues for unnamed temporaries that are never used.
· · ·
22/// TS: `pruneUnusedLValues`
23///
24/// Uses ReactiveFunctionVisitor to collect unnamed lvalue DeclarationIds,
25/// removing them when referenced as operands. After the visitor pass,
26/// a second pass nulls out the remaining unused lvalues.
· · ·
26/// a second pass nulls out the remaining unused lvalues.
27///
28/// This uses a two-phase approach because Rust's ReactiveFunctionVisitor
· · ·
28/// This uses a two-phase approach because Rust's ReactiveFunctionVisitor
29/// takes immutable references, so we cannot modify lvalues during the visit.
30/// The TS version stores mutable instruction references and modifies them
+ 7 more matches in this file
compiler/crates/react_compiler_reactive_scopes/src/rename_variables.rs RUST 39 matches · showing 5 view file →
13use react_compiler_hir::DeclarationId;
14use react_compiler_hir::EvaluationOrder;
15use react_compiler_hir::FunctionId;
16use react_compiler_hir::IdentifierName;
17use react_compiler_hir::InstructionValue;
· · ·
20use react_compiler_hir::PrunedReactiveScopeBlock;
21use react_compiler_hir::ReactiveBlock;
22use react_compiler_hir::ReactiveFunction;
23use react_compiler_hir::ReactiveScopeBlock;
24use react_compiler_hir::ReactiveValue;
· · ·
25use react_compiler_hir::environment::Environment;
26
27use crate::visitors::ReactiveFunctionVisitor;
28use crate::visitors::{self};
29
· · ·
123
124// =============================================================================
125// Visitor — TS: `class Visitor extends ReactiveFunctionVisitor<Scopes>`
126// =============================================================================
127
· · ·
130}
131
132impl ReactiveFunctionVisitor for Visitor<'_> {
133 type State = Scopes;
134
+ 34 more matches in this file
compiler/crates/react_compiler_validation/src/validate_exhaustive_dependencies.rs RUST 49 matches · showing 5 view file →
8use react_compiler_hir::environment_config::ExhaustiveEffectDepsMode;
9use react_compiler_hir::visitors::{
10 each_instruction_value_lvalue, each_instruction_value_operand_with_functions,
11 each_terminal_operand,
12};
· · ·
13use react_compiler_hir::{
14 ArrayElement, BlockId, DependencyPathEntry, HirFunction, Identifier, IdentifierId,
15 InstructionKind, InstructionValue, ManualMemoDependency, ManualMemoDependencyRoot,
16 NonLocalBinding, ParamPattern, Place, PlaceOrSpread, PropertyLiteral, Terminal, Type,
· · ·
23/// will not substantially change program behavior.
24///
25/// Note: takes `&mut HirFunction` (deviating from the read-only validation convention)
26/// because it sets `has_invalid_deps` on StartMemoize instructions when validation
27/// errors are found, so that ValidatePreservedManualMemoization can skip those blocks.
· · ·
28pub fn validate_exhaustive_dependencies(
29 func: &mut HirFunction,
30 env: &mut Environment,
31) -> Result<(), CompilerDiagnostic> {
· · ·
32 let reactive = collect_reactive_identifiers(func, &env.functions);
33 let validate_memo = env.config.validate_exhaustive_memoization_dependencies;
34 let validate_effect = env.config.validate_exhaustive_effect_dependencies.clone();
+ 44 more matches in this file
compiler/crates/react_compiler_validation/src/validate_no_ref_access_in_render.rs RUST 31 matches · showing 5 view file →
11};
12use react_compiler_hir::{
13 AliasingEffect, BlockId, HirFunction, Identifier, IdentifierId, InstructionValue, Place,
14 PrimitiveValue, PropertyLiteral, Terminal, Type, UnaryOperator,
15};
· · ·
322}
323
324// --- Helper functions ---
325
326fn ref_type_of_type(id: IdentifierId, identifiers: &[Identifier], types: &[Type]) -> RefAccessType {
· · ·
426}
427
428fn validate_no_ref_passed_to_function(
429 errors: &mut Vec<CompilerDiagnostic>,
430 env: &Env,
· · ·
450 loc: error_loc,
451 message: Some(
452 "Passing a ref to a function may read its value during render"
453 .to_string(),
454 ),
· · ·
470 loc,
471 message: Some(
472 "Passing a ref to a function may read its value during render"
473 .to_string(),
474 ),
+ 26 more matches in this file
compiler/packages/babel-plugin-react-compiler-rust/native/src/lib.rs RUST 2 matches view file →
16}
17
18/// Main entry point for the React Compiler.
19///
20/// Receives a full program AST, scope information, and resolved options
· · ·
21/// as JSON strings. Returns a JSON string containing the CompileResult.
22///
23/// This function is called by the JS shim (bridge.ts) via napi-rs.
24/// Spawns a dedicated thread with 64MB stack to handle deeply nested ASTs
25/// that would overflow the default Node.js thread stack.
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.