#pragma once #include "./basic_types.hpp" #include "./document_sync.hpp" namespace lsp::protocol { enum class NotebookCellKind { Markup = 1, Code = 2, }; struct ExecutionSummary { uinteger executionOrder; std::optional success; }; struct NotebookCell { NotebookCellKind kind; DocumentUri document; std::optional metadata; std::optional executionSummary; }; struct NotebookDocument { URI uri; string notebookType; integer version; LSPObject metadata; std::vector cells; }; struct NotebookDocumentFilter { string notebookType; std::optional scheme; std::optional pattern; }; struct NotebookCellTextDocumentFilter { std::variant notebook; std::optional language; }; struct NotebookSelector { struct Cell { string language; }; std::variant notebook; std::optional> cells; }; struct NotebookDocumentSyncOptions { std::vector notebookSelector; std::optional save; }; struct NotebookDocumentSyncRegistrationOptions : NotebookDocumentSyncOptions, StaticRegistrationOptions { }; struct NotebookDocumentSyncClientCapabilities { std::optional dynamicRegistration; std::optional executionSummarySupport; }; struct NotebookDocumentClientCapabilities { NotebookDocumentSyncClientCapabilities synchronization; }; struct DidOpenNotebookDocumentParams { NotebookDocument notebookDocument; std::vector cellTextDocuments; }; struct VersionedNotebookDocumentIdentifier { integer version; URI uri; }; struct NotebookCellArrayChange { uinteger start; uinteger deleteCount; std::optional> cells; }; struct NotebookDocumentChangeEvent { struct Cell { struct Structure { NotebookCellArrayChange array; std::optional> didOpen; std::optional> didClose; }; struct TextContent { VersionedTextDocumentIdentifier document; std::vector changes; }; std::optional structure; std::optional> data; std::optional textContent; }; std::optional metadata; std::optional> cells; }; struct DidChangeNotebookDocumentParams { VersionedNotebookDocumentIdentifier notebookDocument; NotebookDocumentChangeEvent change; }; struct NotebookDocumentIdentifier { URI uri; }; struct DidSaveNotebookDocumentParams { NotebookDocumentIdentifier notebookDocument; }; struct DidCloseNotebookDocumentParams { NotebookDocumentIdentifier notebookDocument; std::vector cellTextDocuments; }; }