Skip to content

Applying Edits/Undo Stack - GLSP/Langium Integration - VSCode Extension/Node Server #1519

Answered by jmenzies12
jmenzies12 asked this question in Q&A
Discussion options

You must be logged in to vote

@martin-fleck-at,

Just a quick update, incase you or anyone else is curious.

I spent more time on it and came up with a better solution (this removes the need for delaying the applyEdit and confusion of having conflicting operations at once):

  • Created new operation handlers (DocumentOperationHandler) for specific operations that affect the langium document
  • Created a custom command for these operations that is non undoable
  • Extended the ModelSubmissionHandler with a new function 'submitModelFromDocumentEdit', this is identical to submitModel except the SetDirtyStateAction is always set as true, instead of checking the command stack (due to the lack of undoable command) and then we pass in '…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@martin-fleck-at
Comment options

@jmenzies12
Comment options

@martin-fleck-at
Comment options

@jmenzies12
Comment options

Answer selected by jmenzies12
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants