Skip to content

What triggers workspace.onDidChangeTextDocument? #90

Discussion options

You must be logged in to vote

Hi @worksofliam ,

Based on its documentation (https://code.visualstudio.com/api/references/vscode-api) it says:

An event that is emitted when a text document is changed. This usually happens when the contents changes but also when other things like the dirty-state changes.

I would expand this description with a few scenarios: It is triggered when:

  • When the user types something
  • When Undo and Redo are fired
  • When Save is fired
  • When Formatters are fired

And yes, also when discarding changes with Git

Hope this helps

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@worksofliam
Comment options

@alefragnani
Comment options

Answer selected by isidorn
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
Labels
None yet
3 participants