pub struct TypeScriptAdapter;Expand description
TypeScript / JavaScript language adapter.
Implementations§
Trait Implementations§
Source§impl Clone for TypeScriptAdapter
impl Clone for TypeScriptAdapter
impl Copy for TypeScriptAdapter
Source§impl Debug for TypeScriptAdapter
impl Debug for TypeScriptAdapter
Source§impl Default for TypeScriptAdapter
impl Default for TypeScriptAdapter
Source§impl LanguageAdapter for TypeScriptAdapter
impl LanguageAdapter for TypeScriptAdapter
Source§fn file_extensions(&self) -> &'static [&'static str]
fn file_extensions(&self) -> &'static [&'static str]
File extensions this adapter handles, without the leading dot.
Used by the shared index pipeline for file dispatch.
Default: empty (adapter is never auto-selected by extension).
Source§fn parse_symbols(&self, file: &str, source: &str) -> Result<Vec<ParsedSymbol>>
fn parse_symbols(&self, file: &str, source: &str) -> Result<Vec<ParsedSymbol>>
Parse a file and return declared symbols.
Source§fn infer_effects(&self, _source: &str, symbol: &ParsedSymbol) -> Vec<Effect>
fn infer_effects(&self, _source: &str, symbol: &ParsedSymbol) -> Vec<Effect>
Heuristic effect inference for a symbol. Returns an empty Vec when
the adapter has no opinion (author must declare explicitly).
Source§fn infer_service_endpoints(
&self,
file: &str,
source: &str,
symbols: &[ParsedSymbol],
) -> Vec<DetectedEndpoint>
fn infer_service_endpoints( &self, file: &str, source: &str, symbols: &[ParsedSymbol], ) -> Vec<DetectedEndpoint>
Detect cross-service endpoints (HTTP routes/clients, pub-sub
emit/listen) in a file. Returns
DetectedEndpoints attributed to the
owning symbol by qname; the index pipeline enriches them with repo +
symbol identity. Whole-file signature (not per-symbol) because the
signal often lives just outside a symbol’s body (e.g. a route decorator
above a def). Default: empty — adapters opt in. Read moreSource§fn extract_call_edges(
&self,
file: &str,
source: &str,
symbols: &[ParsedSymbol],
workspace: &WorkspaceSymbols,
) -> Vec<CallEdge>
fn extract_call_edges( &self, file: &str, source: &str, symbols: &[ParsedSymbol], workspace: &WorkspaceSymbols, ) -> Vec<CallEdge>
Extract call edges from a file’s parsed symbols. Returned pairs are
(caller_qname, callee_qname). The adapter is free to use heuristics;
resolution quality is best-effort. Read more
Source§fn scan_dynamic_dispatch(
&self,
_file: &str,
_source: &str,
) -> Vec<DynamicDispatchHint>
fn scan_dynamic_dispatch( &self, _file: &str, _source: &str, ) -> Vec<DynamicDispatchHint>
Plan L t-005: report dynamic-dispatch sites in the file’s source.
These are call patterns the static call-graph walker can’t resolve
(e.g.
getattr(obj, attr_name)(args), callback-by-argument,
metaclass tricks). Returning a non-empty list signals to the
indexer that some call paths in this file won’t show up in the
graph; the indexer surfaces a one-line warning so agents/humans
know the missing edges aren’t a bug, they’re a known limit. Read moreSource§fn report_unresolved_calls(
&self,
_file: &str,
_source: &str,
_symbols: &[ParsedSymbol],
_workspace: &WorkspaceSymbols,
) -> Vec<UnresolvedCall>
fn report_unresolved_calls( &self, _file: &str, _source: &str, _symbols: &[ParsedSymbol], _workspace: &WorkspaceSymbols, ) -> Vec<UnresolvedCall>
Plan L t-006: report call sites in this file whose function
position couldn’t be resolved to a workspace qname. Default:
empty. Adapters that can compute this cheaply override.
Source§fn resolve_endpoint_prefixes(
&self,
_files: &[(String, String)],
_endpoints: &mut Vec<ServiceEndpoint>,
)
fn resolve_endpoint_prefixes( &self, _files: &[(String, String)], _endpoints: &mut Vec<ServiceEndpoint>, )
Project-level pass (Plan Q t-004b): rewrite endpoint contracts using
cross-file context — e.g. resolving nested router-mount prefix chains
(
app.include_router(api, prefix="/api") → api.include_router(calc, prefix="/calc") → @calc.get("/x") = /api/calc/x) that span files.
files is (path, source) for THIS adapter’s language; endpoints is
the full project set — the adapter must only touch its own. Runs once
after per-file detection. Default: no-op.Source§fn extract_dataflow(
&self,
_file: &str,
_source: &str,
_symbols: &[ParsedSymbol],
_workspace: &WorkspaceSymbols,
) -> Vec<DetectedDataFlow>
fn extract_dataflow( &self, _file: &str, _source: &str, _symbols: &[ParsedSymbol], _workspace: &WorkspaceSymbols, ) -> Vec<DetectedDataFlow>
Detect intra-process data-flow sites (
arg → param at call sites) in a
file. Returns DetectedDataFlow naming caller/callee by qname plus the
argument and its position; the index pipeline resolves the callee’s
parameter name and symbol identity. Default: empty — adapters opt in. Read moreSource§fn extract_property_types(
&self,
_symbols: &[ParsedSymbol],
) -> HashMap<String, String>
fn extract_property_types( &self, _symbols: &[ParsedSymbol], ) -> HashMap<String, String>
Extract stored property declarations from a file’s parsed symbols,
returning
"EnclosingTypeSimpleName.propertyName" → "TypeSimpleName". Read moreAuto Trait Implementations§
impl Freeze for TypeScriptAdapter
impl RefUnwindSafe for TypeScriptAdapter
impl Send for TypeScriptAdapter
impl Sync for TypeScriptAdapter
impl Unpin for TypeScriptAdapter
impl UnsafeUnpin for TypeScriptAdapter
impl UnwindSafe for TypeScriptAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more