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

Function open_file

tests/integration/references.rs:100–106  ·  view source on GitHub ↗

Helper: open a file in the backend by calling update_ast directly and storing the content in open_files so find_references can read it.

(backend: &phpantom_lsp::Backend, uri: &str, content: &str)

Source from the content-addressed store, hash-verified

98/// Helper: open a file in the backend by calling update_ast directly
99/// and storing the content in open_files so find_references can read it.
100fn open_file(backend: &phpantom_lsp::Backend, uri: &str, content: &str) {
101 backend
102 .open_files()
103 .write()
104 .insert(uri.to_string(), Arc::new(content.to_string()));
105 backend.update_ast(uri, content);
106}
107
108/// Helper to assert no duplicate locations exist in the results.
109fn assert_no_duplicates(results: &[tower_lsp::lsp_types::Location], label: &str) {

Calls 4

writeMethod · 0.80
open_filesMethod · 0.80
update_astMethod · 0.80
insertMethod · 0.45