MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / populate_method_store

Method populate_method_store

src/lib.rs:976–985  ·  view source on GitHub ↗

Populate the method store from a slice of classes. For each class, inserts every method under the key `(class_fqn, method.name)`. Called from `update_ast_inner` and `parse_and_cache_content_versioned` after classes are parsed.

(&self, classes: &[Arc<ClassInfo>])

Source from the content-addressed store, hash-verified

974 /// `(class_fqn, method.name)`. Called from `update_ast_inner`
975 /// and `parse_and_cache_content_versioned` after classes are parsed.
976 pub(crate) fn populate_method_store(&self, classes: &[Arc<ClassInfo>]) {
977 let mut store = self.method_store.write();
978 for cls in classes {
979 let fqn = cls.fqn().to_string();
980 for method in &cls.methods {
981 let key = (fqn.clone(), method.name.to_string());
982 store.insert(key, Arc::clone(method));
983 }
984 }
985 }
986
987 /// Remove all method store entries whose class FQN matches any of
988 /// the given FQNs.

Callers 2

update_ast_innerMethod · 0.80

Calls 4

writeMethod · 0.80
fqnMethod · 0.80
cloneMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected