Text Document Service

Summary

Processes text document events from vscode.

  • Listen to OnDidSaveTextDocument to keep notes on disk in sync with engine
  • Process TextDocumentChangeEvent to return updated notes. Does not sync with engine as it does not reflect disk status

For how this service interacts with the workspace, see User actions

Entry

Lifecycle

// also called by `PreviewPanel`
processTextDocumentChangeEvent {
    ctx = "TextDocumentService:processTextDocumentChangeEvent"
    @updateNoteContents
    log "exit"

}
// Callback function for `vscode.workspace.OnDidSaveTextDocument`
onDidSave {
    ctx = "TextDocumentService:onDidSave"
    @updateNoteContents
    log "exit"

}
// also called by `buttons.selection2link`
updateNoteContents {
    ctx = "TextDocumentService:updateNoteContents"
    @updateNoteMetadata
    log "exit"

}

Backlinks