MCPcopy Index your code
hub / github.com/PHPantom-dev/phpantom_lsp / open_files

Function open_files

tests/fixture_runner.rs:379–401  ·  view source on GitHub ↗

Open all fixture files on the backend via the public `did_open` LSP method. Returns the URI of the cursor file.

(backend: &Backend, fixture: &ParsedFixture)

Source from the content-addressed store, hash-verified

377/// Open all fixture files on the backend via the public `did_open` LSP method.
378/// Returns the URI of the cursor file.
379async fn open_files(backend: &Backend, fixture: &ParsedFixture) -> Url {
380 let mut cursor_uri = None;
381
382 for (i, file) in fixture.files.iter().enumerate() {
383 let uri = file_uri(&file.path);
384
385 let open_params = DidOpenTextDocumentParams {
386 text_document: TextDocumentItem {
387 uri: uri.clone(),
388 language_id: "php".to_string(),
389 version: 0,
390 text: file.content.clone(),
391 },
392 };
393 backend.did_open(open_params).await;
394
395 if i == fixture.cursor_file {
396 cursor_uri = Some(uri);
397 }
398 }
399
400 cursor_uri.expect("cursor file not opened")
401}
402
403// ─── Feature runners ────────────────────────────────────────────────────────
404

Callers 4

run_completionFunction · 0.85
run_hoverFunction · 0.85
run_definitionFunction · 0.85
run_signature_helpFunction · 0.85

Calls 4

file_uriFunction · 0.85
iterMethod · 0.80
cloneMethod · 0.80
did_openMethod · 0.45

Tested by

no test coverage detected