{"record":{"id":"c3e91aed5122f483","repo":"biomejs/biome","slug":"scanning-task-to-complete-successfully","errorCode":null,"errorMessage":"Scanning task to complete successfully","messagePattern":"Scanning task to complete successfully","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_lsp/src/session.rs","lineNumber":439,"sourceCode":"            .map(|(_project_path, project_key)| *project_key)\n    }\n\n    /// Registers an open project with its root path and scans the folder.\n    #[tracing::instrument(level = \"debug\", skip(self))]\n    pub(crate) async fn insert_and_scan_project(\n        self: &Arc<Self>,\n        project_key: ProjectKey,\n        path: BiomePath,\n        scan_kind: ScanKind,\n        force: bool,\n    ) {\n        self.projects.pin().insert(path.clone(), project_key);\n\n        // Spawn the scan in the background, to avoid timing out the LSP request.\n        let session = self.clone();\n        spawn(async move { session.scan_project(project_key, scan_kind, force).await })\n            .await\n            .expect(\"Scanning task to complete successfully\");\n    }\n\n    /// Get a [`Document`] matching the provided [`Uri`]\n    ///\n    /// If document does not exist, result is [WorkspaceError::NotFound]\n    pub(crate) fn document(&self, url: &Uri) -> Option<Document> {\n        self.documents.pin().get(url).cloned()\n    }\n\n    /// Set the [`Document`] for the provided [`Uri`]\n    ///\n    /// Used by [`handlers::text_document] to synchronize documents with the client.\n    pub(crate) fn insert_document(&self, url: Uri, document: Document) {\n        self.documents.pin().insert(url, document);\n    }\n\n    /// Remove the [`Document`] matching the provided [`Uri`]\n    pub(crate) fn remove_document(&self, url: &Uri) -> Option<ProjectKey> {","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/biomejs/biome/blob/0fca643d22845c28e0e0b7375013155e3f80717f/crates/biome_lsp/src/session.rs#L421-L457","documentation":"Error \"Scanning task to complete successfully\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_lsp/src/session.rs:438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the workspace scanner task was not cancelled before awaiting its result.","Investigate earlier scanner errors in the logs; the join failure usually follows a panic in the scanner thread."],"exampleFix":"// Handle the JoinError instead of expecting: handle.await.map_err(...)?","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0fca643d22845c28e0e0b7375013155e3f80717f","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}