{"record":{"id":"0968ebf1c78bd706","repo":"biomejs/biome","slug":"to-to-have-a-utf-8-path","errorCode":null,"errorMessage":"To to have a UTF-8 path","messagePattern":"To to have a UTF-8 path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_lsp/src/session.rs","lineNumber":557,"sourceCode":"        // also lets this task see the latest request before deciding whether to\n        // schedule another diagnostics update.\n        if entry.rerun_after_current.swap(false, Ordering::AcqRel) {\n            let latest_version = entry.scheduled_version.load(Ordering::Acquire);\n            if latest_version != version && !entry.closed.load(Ordering::Acquire) {\n                self.spawn_delayed_diagnostics(url, entry, latest_version);\n            }\n        }\n    }\n\n    pub(crate) fn file_path(&self, url: &Uri) -> Result<BiomePath> {\n        let path_to_file = match url.to_file_path() {\n            None => {\n                // If we can't create a path, it's probably because the file doesn't exist.\n                // It can be a newly created file that it's not on disk\n                Utf8PathBuf::from(url.path().to_string())\n            }\n            Some(path) => Utf8PathBuf::from_path_buf(path.as_ref().to_path_buf())\n                .expect(\"To to have a UTF-8 path\"),\n        };\n\n        Ok(BiomePath::new(path_to_file))\n    }\n\n    /// Computes diagnostics for the file matching the provided url and publishes\n    /// them to the client. Called from [`handlers::text_document`] when a file's\n    /// contents changes.\n    #[tracing::instrument(level = \"debug\", skip_all, fields(url = display(url.as_str()), diagnostic_count), err)]\n    pub(crate) async fn update_diagnostics(&self, url: Uri) -> Result<(), LspError> {\n        let Some(doc) = self.document(&url) else {\n            return Ok(());\n        };\n        self.update_diagnostics_for_document(url.clone(), doc, None)\n            .await\n    }\n\n    async fn update_diagnostics_for_version(","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/biomejs/biome/blob/0fca643d22845c28e0e0b7375013155e3f80717f/crates/biome_lsp/src/session.rs#L539-L575","documentation":"Error \"To to have a UTF-8 path\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_lsp/src/session.rs:556 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the URI received by the LSP server maps to a valid UTF-8 file path.","Reject or normalize non-UTF-8 document URIs at the session boundary."],"exampleFix":"let path = url_to_path(&uri).ok_or_else(|| /* invalid URI error */)?;","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-14T05:17:10.506Z"}