How do I detect in a Theia extension whether a document has been modified and saved? #9041
-
We wrote a Theia extension, and we would like to receive an event every time a document (java source file, for example) is modified and saved. Incremental changes before the actual Save are irrelevant for us. |
Beta Was this translation helpful? Give feedback.
Answered by
vince-fugnitto
Feb 8, 2021
Replies: 1 comment 9 replies
-
@tsiyona you can listen to the From the event you'll have access to the |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
vince-fugnitto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tsiyona you can listen to the
onDidSaveTextDocument
event (documents are represented by underlyingmodels
):theia/packages/monaco/src/browser/monaco-workspace.ts
Line 85 in 27e6ea7
From the event you'll have access to the
MonacoEditorModel
from which you can have special handling forjava
files as example if that's your use-case.