{"record":{"id":"279ef325b36ced5d","repo":"astral-sh/ruff","slug":"text-document-uri-does-not-point-to-a-text-documen","errorCode":null,"errorMessage":"Text document URI does not point to a text document","messagePattern":"Text document URI does not point to a text document","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_server/src/session/index.rs","lineNumber":114,"sourceCode":"    }\n\n    pub(super) fn notebook_document_uris(&self) -> impl Iterator<Item = &Uri> + '_ {\n        self.documents\n            .iter()\n            .filter(|(_, doc)| doc.as_notebook().is_some())\n            .map(|(uri, _)| uri)\n    }\n\n    pub(super) fn update_text_document(\n        &mut self,\n        key: &DocumentKey,\n        content_changes: Vec<lsp_types::TextDocumentContentChangeEvent>,\n        new_version: DocumentVersion,\n        encoding: PositionEncoding,\n    ) -> crate::Result<()> {\n        let controller = self.document_controller_for_key(key)?;\n        let Some(document) = controller.as_text_mut() else {\n            anyhow::bail!(\"Text document URI does not point to a text document\");\n        };\n\n        if content_changes.is_empty() {\n            document.update_version(new_version);\n            return Ok(());\n        }\n\n        document.apply_changes(content_changes, new_version, encoding);\n\n        Ok(())\n    }\n\n    pub(super) fn key_from_uri(&self, uri: Uri) -> DocumentKey {\n        if self.notebook_cells.contains_key(&uri) {\n            DocumentKey::NotebookCell(uri)\n        } else if self\n            .documents\n            .get(&uri)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ruff_server/src/session/index.rs#L96-L132","documentation":"Error \"Text document URI does not point to a text document\" thrown in astral-sh/ruff.","triggerScenarios":"Thrown at crates/ruff_server/src/session/index.rs:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}