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

Method clear_file_maps

src/util.rs:1697–1712  ·  view source on GitHub ↗

Remove a file's entries from `uri_classes_index`, `use_map`, and `namespace_map`. This is the mirror of [`file_context`](Self::file_context): where that method *reads* the three maps, this method *clears* them for a given URI. Called from `did_close` to clean up state when a file is closed.

(&self, uri: &str)

Source from the content-addressed store, hash-verified

1695 /// method *reads* the three maps, this method *clears* them for a given URI.
1696 /// Called from `did_close` to clean up state when a file is closed.
1697 pub(crate) fn clear_file_maps(&self, uri: &str) {
1698 // Drop per-file maps that are only needed while the file is
1699 // open. uri_classes_index is redundant with fqn_class_index once indexing is
1700 // complete — GTD falls back to fqn_uri_index + parse_and_cache_file
1701 // when the uri_classes_index entry is missing.
1702 self.uri_classes_index.write().remove(uri);
1703 self.symbol_maps.write().remove(uri);
1704 self.file_imports.write().remove(uri);
1705 self.resolved_names.write().remove(uri);
1706 self.file_namespaces.write().remove(uri);
1707 // NOTE: We intentionally keep fqn_uri_index and fqn_class_index intact.
1708 // fqn_uri_index maps FQN → URI so GTD can locate the file, and
1709 // fqn_class_index keeps the full ClassInfo for cross-file resolution.
1710 // The file will be re-parsed from disk on next access via
1711 // parse_and_cache_file when needed (issue #99).
1712 }
1713
1714 pub(crate) async fn log(&self, typ: MessageType, message: String) {
1715 if let Some(client) = &self.client {

Callers 1

did_closeMethod · 0.80

Calls 2

removeMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected