What triggers workspace.onDidChangeTextDocument
?
#90
-
Hi! I am wondering what triggers Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @worksofliam , Based on its documentation (https://code.visualstudio.com/api/references/vscode-api) it says:
I would expand this description with a few scenarios: It is triggered when:
And yes, also when discarding changes with Git Hope this helps |
Beta Was this translation helpful? Give feedback.
-
TextDocument.contents is "what should the text editor show for this file". VS Code watches files and updates its view of their contents even when an external program runs like Also, if the document doesn't have an editor open, there might not be a TextDocument object for that filename. |
Beta Was this translation helpful? Give feedback.
Hi @worksofliam ,
Based on its documentation (https://code.visualstudio.com/api/references/vscode-api) it says:
I would expand this description with a few scenarios: It is triggered when:
Undo
andRedo
are firedSave
is firedAnd yes, also when discarding changes with Git
Hope this helps