Expand description
Document opening and content resolution logic.
Implements OpenDocument for MountainEnvironment. Resolution order:
- Already open - if the URI is already in
OpenDocuments, re-emitssky://documents/openso the Sky workbench focuses the existing tab and returns immediately without a disk read. - Caller-supplied content - if the
contentargument isSome, it is used verbatim (used by untitled / virtual documents). file://URI - content is read from disk viaApplicationRunTime.- Custom scheme - content is fetched from the Cocoon sidecar via
$provideTextDocumentContentRPC (10 s timeout). This covers schemes likegit:,output:,vscode-notebook-cell:, etc.
On success, a new DocumentStateDTO is inserted into OpenDocuments,
sky://documents/open is emitted to the Sky workbench, and
$acceptModelAdded is sent to Cocoon.
Functionsยง
- open_
document ๐ - Opens a document. If the URI scheme is not native (
file), it attempts to resolve the content from a registered sidecar provider (TextDocumentContentProvider).