I am creating a small VSCode Extension. I found a event that emits when the document is changed:
vscode.workspace.onDidChangeTextDocument(function(e) {