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

Method populate_autoload_indices

src/server.rs:2139–2152  ·  view source on GitHub ↗

Store the function and constant indices from a workspace scan into the backend's shared maps. Only has an effect for non-Composer projects (the "no `composer.json`" scenario) where the full-scan populates function and constant entries. For Composer projects the scan result's function and constant indices are empty because those symbols are discovered via the `autoload_files.php` scan loop in `in

(&self, scan: &WorkspaceScanResult)

Source from the content-addressed store, hash-verified

2137 /// symbols are discovered via the `autoload_files.php` scan loop
2138 /// in `initialized()` instead.
2139 pub(crate) fn populate_autoload_indices(&self, scan: &WorkspaceScanResult) {
2140 if !scan.function_index.is_empty() {
2141 let mut idx = self.autoload_function_index.write();
2142 for (fqn, path) in &scan.function_index {
2143 idx.entry(fqn.clone()).or_insert_with(|| path.clone());
2144 }
2145 }
2146 if !scan.constant_index.is_empty() {
2147 let mut idx = self.autoload_constant_index.write();
2148 for (name, path) in &scan.constant_index {
2149 idx.entry(name.clone()).or_insert_with(|| path.clone());
2150 }
2151 }
2152 }
2153}

Callers 3

init_single_projectMethod · 0.80
init_monorepoMethod · 0.80
init_no_composerMethod · 0.80

Calls 3

writeMethod · 0.80
cloneMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected