I would like to be able to capture keystrokes in a visual studio code extension. I need to know the new text that was either added or removed and the position of the change in t
I discovered the problem in my original question. I was listening for the wrong event. To get TextDocumentChangeEvents which have a property called contentChanges which returns TextDocumentContentChangeEvents, use this code:
vscode.workspace.onDidChangeTextDocument(handleChange)
and pass in a function which will be called with a TextDocumentChangeEvent on every change to a file.