Expand description
§Text Model registry + TextFile handlers
Two related responsibilities sharing the same dispatcher family:
Model*- Monaco-side text model registry. Mountain ownsApplicationState.Feature.Documents; Wind reads/writes through these handlers so the document state survives a webview reload.Textfile*- disk-only paths that bypass the registry. Used for tooling reads (settings, manifests) and for the actual save round-trip.
Layout (one export per file, file name = identity):
ModelOpen::ModelOpen,ModelClose::ModelClose,ModelGet::ModelGet,ModelGetAll::ModelGetAll,ModelUpdateContent::ModelUpdateContent.TextfileRead::TextfileRead,TextfileWrite::TextfileWrite,TextfileSave::TextfileSave.
Modules§
- Model
Close - Close a text model. Drops the entry from
ApplicationState.Feature.Documents. Idempotent - closing an already-closed URI is a no-op. - Model
Get - Snapshot a single open text model. Returns
{ uri, content, version, languageId }ornullwhen the URI isn’t currently open.contentis rejoined fromLinesusing the document’s EOL so the wire shape matches VS Code’sTextDocument.getText(). - Model
GetAll - Bulk snapshot of every open text model. Used by Wind on
workbench restore to repopulate the Monaco model registry
without per-tab
ModelOpenround-trips. - Model
Open - Open a text model: read content from disk, derive language
ID from the extension, register the resulting
DocumentStateDTOinApplicationState.Feature.Documents, and return{ uri, content, version, languageId }to Wind. - Model
Update Content - Replace an open model’s content. Increments
Version, recomputesLines, marksIsDirty=true. Mirrors VS Code’sTextDocument.update(...)semantics - the Monaco model observers see a single coherent edit, not partial state. - Textfile
Read - Read a text file from disk verbatim. Distinct from
ModelOpen- this returns the bytes without registering aDocumentStateDTO. Used by tooling paths that want raw content (e.g. import resolvers, settings inspectors). - Textfile
Save - Save-intent hint. Actual disk write happens via
TextfileWrite; this command exists so Wind can clear the editor’s dirty-dot UI marker without writing twice. Logged at thevfstag so a save trace appears inMountain.dev.log. - Textfile
Write - Write text to a file on disk. Counterpart to
TextfileRead; does not touch the document registry. Callers wanting Monaco to observe the change should follow up withModelUpdateContentfor the same URI.