pub trait MirDatabase: Database {
Show 23 methods
// Required methods
fn php_version_str(&self) -> Arc<str> ⓘ;
fn lookup_class_node(&self, fqcn: &str) -> Option<ClassNode>;
fn lookup_function_node(&self, fqn: &str) -> Option<FunctionNode>;
fn lookup_method_node(
&self,
fqcn: &str,
method_name_lower: &str,
) -> Option<MethodNode>;
fn lookup_property_node(
&self,
fqcn: &str,
prop_name: &str,
) -> Option<PropertyNode>;
fn lookup_class_constant_node(
&self,
fqcn: &str,
const_name: &str,
) -> Option<ClassConstantNode>;
fn lookup_global_constant_node(
&self,
fqn: &str,
) -> Option<GlobalConstantNode>;
fn class_own_methods(&self, fqcn: &str) -> Vec<MethodNode>;
fn class_own_properties(&self, fqcn: &str) -> Vec<PropertyNode>;
fn active_class_node_fqcns(&self) -> Vec<Arc<str>>;
fn active_function_node_fqns(&self) -> Vec<Arc<str>>;
fn file_namespace(&self, file: &str) -> Option<Arc<str>>;
fn file_imports(&self, file: &str) -> HashMap<String, String>;
fn global_var_type(&self, name: &str) -> Option<Union>;
fn file_import_snapshots(&self) -> Vec<(Arc<str>, HashMap<String, String>)>;
fn symbol_defining_file(&self, symbol: &str) -> Option<Arc<str>>;
fn symbols_defined_in_file(&self, file: &str) -> Vec<Arc<str>>;
fn record_reference_location(&self, loc: RefLoc);
fn replay_reference_locations(
&self,
file: Arc<str>,
locs: &[(String, u32, u16, u16)],
);
fn extract_file_reference_locations(
&self,
file: &str,
) -> Vec<(Arc<str>, u32, u16, u16)>;
fn reference_locations(
&self,
symbol: &str,
) -> Vec<(Arc<str>, u32, u16, u16)>;
fn has_reference(&self, symbol: &str) -> bool;
fn clear_file_references(&self, file: &str);
}Expand description
Salsa database trait for mir incremental analysis.
Required Methods§
Sourcefn php_version_str(&self) -> Arc<str> ⓘ
fn php_version_str(&self) -> Arc<str> ⓘ
The PHP version configured for this analysis run.
Sourcefn lookup_class_node(&self, fqcn: &str) -> Option<ClassNode>
fn lookup_class_node(&self, fqcn: &str) -> Option<ClassNode>
Look up the ClassNode handle registered for fqcn, if any.
This is an untracked read — the DashMap holds Salsa input handles
(cheap IDs), not data. Changes to a class’s fields (parent,
interfaces, active state) are tracked through the ClassNode input
itself, so downstream queries are still correctly invalidated.
Sourcefn lookup_function_node(&self, fqn: &str) -> Option<FunctionNode>
fn lookup_function_node(&self, fqn: &str) -> Option<FunctionNode>
Look up the FunctionNode handle registered for fqn, if any.
Sourcefn lookup_method_node(
&self,
fqcn: &str,
method_name_lower: &str,
) -> Option<MethodNode>
fn lookup_method_node( &self, fqcn: &str, method_name_lower: &str, ) -> Option<MethodNode>
Look up the MethodNode for (fqcn, method_name_lower), if any.
method_name_lower must already be lowercased. This is an untracked
read — changes to a method’s fields are tracked through the MethodNode
input itself.
Sourcefn lookup_property_node(
&self,
fqcn: &str,
prop_name: &str,
) -> Option<PropertyNode>
fn lookup_property_node( &self, fqcn: &str, prop_name: &str, ) -> Option<PropertyNode>
Look up the PropertyNode for (fqcn, prop_name), if any.
Sourcefn lookup_class_constant_node(
&self,
fqcn: &str,
const_name: &str,
) -> Option<ClassConstantNode>
fn lookup_class_constant_node( &self, fqcn: &str, const_name: &str, ) -> Option<ClassConstantNode>
Look up the ClassConstantNode for (fqcn, const_name), if any.
Sourcefn lookup_global_constant_node(&self, fqn: &str) -> Option<GlobalConstantNode>
fn lookup_global_constant_node(&self, fqn: &str) -> Option<GlobalConstantNode>
Look up the GlobalConstantNode for fqn, if any.
Sourcefn class_own_methods(&self, fqcn: &str) -> Vec<MethodNode>
fn class_own_methods(&self, fqcn: &str) -> Vec<MethodNode>
Return all own-method nodes for fqcn. Empty if no class is
registered. Untracked iteration of a per-class HashMap.
Sourcefn class_own_properties(&self, fqcn: &str) -> Vec<PropertyNode>
fn class_own_properties(&self, fqcn: &str) -> Vec<PropertyNode>
Return all own-property nodes for fqcn. Empty if no class is
registered. Untracked iteration of a per-class HashMap.
Sourcefn active_class_node_fqcns(&self) -> Vec<Arc<str>>
fn active_class_node_fqcns(&self) -> Vec<Arc<str>>
Return all class-FQCNs currently registered as active ClassNodes,
optionally filtered by kind. Untracked snapshot — callers should
treat the returned Vec as a one-shot view.
Sourcefn active_function_node_fqns(&self) -> Vec<Arc<str>>
fn active_function_node_fqns(&self) -> Vec<Arc<str>>
Return all function-FQNs currently registered as active
FunctionNodes. Untracked snapshot.
Sourcefn file_namespace(&self, file: &str) -> Option<Arc<str>>
fn file_namespace(&self, file: &str) -> Option<Arc<str>>
Return this file’s first declared namespace, if any.
Sourcefn file_imports(&self, file: &str) -> HashMap<String, String>
fn file_imports(&self, file: &str) -> HashMap<String, String>
Return this file’s use alias map.
Sourcefn global_var_type(&self, name: &str) -> Option<Union>
fn global_var_type(&self, name: &str) -> Option<Union>
Return the known type for a PHP global variable.
Sourcefn file_import_snapshots(&self) -> Vec<(Arc<str>, HashMap<String, String>)>
fn file_import_snapshots(&self) -> Vec<(Arc<str>, HashMap<String, String>)>
Return (file, imports) snapshots for every known file.
Sourcefn symbol_defining_file(&self, symbol: &str) -> Option<Arc<str>>
fn symbol_defining_file(&self, symbol: &str) -> Option<Arc<str>>
Return the defining file for a symbol, if known.
Sourcefn symbols_defined_in_file(&self, file: &str) -> Vec<Arc<str>>
fn symbols_defined_in_file(&self, file: &str) -> Vec<Arc<str>>
Return all symbols whose defining file is file.
Sourcefn record_reference_location(&self, loc: RefLoc)
fn record_reference_location(&self, loc: RefLoc)
Record a reference-location entry.
Sourcefn replay_reference_locations(
&self,
file: Arc<str>,
locs: &[(String, u32, u16, u16)],
)
fn replay_reference_locations( &self, file: Arc<str>, locs: &[(String, u32, u16, u16)], )
Replay reference locations for one file from cache.
Sourcefn extract_file_reference_locations(
&self,
file: &str,
) -> Vec<(Arc<str>, u32, u16, u16)>
fn extract_file_reference_locations( &self, file: &str, ) -> Vec<(Arc<str>, u32, u16, u16)>
Extract reference locations for one file in cache-storage shape.
Sourcefn reference_locations(&self, symbol: &str) -> Vec<(Arc<str>, u32, u16, u16)>
fn reference_locations(&self, symbol: &str) -> Vec<(Arc<str>, u32, u16, u16)>
Return all reference locations for one public symbol key.
Sourcefn has_reference(&self, symbol: &str) -> bool
fn has_reference(&self, symbol: &str) -> bool
Whether the public symbol key has at least one recorded reference.
Sourcefn clear_file_references(&self, file: &str)
fn clear_file_references(&self, file: &str)
Clear reference locations for a file before re-analysis.