(path: &Path, content: String)
| 340 | // ─── Test execution ───────────────────────────────────────────────────────── |
| 341 | |
| 342 | fn run_fixture(path: &Path, content: String) -> datatest_stable::Result<()> { |
| 343 | let fixture = |
| 344 | parse_fixture(&content).map_err(|e| format!("Failed to parse {}: {e}", path.display()))?; |
| 345 | |
| 346 | // Handle ignored fixtures. |
| 347 | if let Some(reason) = &fixture.meta.ignore { |
| 348 | eprintln!("IGNORED: {reason}"); |
| 349 | return Ok(()); |
| 350 | } |
| 351 | |
| 352 | // Use a single-threaded tokio runtime for async LSP calls. |
| 353 | let rt = tokio::runtime::Builder::new_current_thread() |
| 354 | .enable_all() |
| 355 | .build() |
| 356 | .map_err(|e| format!("Failed to build tokio runtime: {e}"))?; |
| 357 | |
| 358 | rt.block_on(async { |
| 359 | match fixture.meta.feature { |
| 360 | Feature::Completion => run_completion(&fixture).await, |
| 361 | Feature::Hover => run_hover(&fixture).await, |
| 362 | Feature::Definition => run_definition(&fixture).await, |
| 363 | Feature::SignatureHelp => run_signature_help(&fixture).await, |
| 364 | } |
| 365 | }) |
| 366 | .map_err(|e| format!("{} — {e}", path.display()))?; |
| 367 | |
| 368 | Ok(()) |
| 369 | } |
| 370 | |
| 371 | /// Build a URI for a fixture file path. |
| 372 | fn file_uri(path: &str) -> Url { |
nothing calls this directly
no test coverage detected