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)
| 377 | /// Open all fixture files on the backend via the public `did_open` LSP method. |
| 378 | /// Returns the URI of the cursor file. |
| 379 | async 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 |
no test coverage detected