{"record":{"id":"1dc11b799f729310","repo":"astral-sh/ruff","slug":"notebook-document-uri-does-not-point-to-a-notebook","errorCode":null,"errorMessage":"Notebook document URI does not point to a notebook document","messagePattern":"Notebook document URI does not point to a notebook document","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_server/src/session/index.rs","lineNumber":168,"sourceCode":"        if let Some(lsp_types::NotebookDocumentCellChangeStructure {\n            did_open: Some(did_open),\n            ..\n        }) = cells.as_ref().and_then(|cells| cells.structure.as_ref())\n        {\n            let Some(path) = self.uri_for_key(key).cloned() else {\n                anyhow::bail!(\"Tried to open unavailable document `{key}`\");\n            };\n\n            for opened_cell in did_open {\n                self.notebook_cells\n                    .insert(opened_cell.uri.clone(), path.clone());\n            }\n            // deleted notebook cells are closed via textDocument/didClose - we don't close them here.\n        }\n\n        let controller = self.document_controller_for_key(key)?;\n        let Some(notebook) = controller.as_notebook_mut() else {\n            anyhow::bail!(\"Notebook document URI does not point to a notebook document\");\n        };\n\n        notebook.update(cells, metadata, new_version, encoding)?;\n        Ok(())\n    }\n\n    pub(super) fn open_workspace_folder(\n        &mut self,\n        uri: Uri,\n        global: &GlobalClientSettings,\n        client: &Client,\n    ) -> crate::Result<()> {\n        // TODO(jane): Find a way for workspace client settings to be added or changed dynamically.\n        self.settings\n            .register_workspace(&Workspace::new(uri), global, client)\n    }\n\n    pub(super) fn close_workspace_folder(&mut self, workspace_uri: &Uri) -> crate::Result<()> {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ruff_server/src/session/index.rs#L150-L186","documentation":"Error \"Notebook document URI does not point to a notebook document\" thrown in astral-sh/ruff.","triggerScenarios":"Thrown at crates/ruff_server/src/session/index.rs:168 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"}