onDidChangeTextDocument

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.

Introduce

Parameter

Name Type Description
listener Function(TextDocumentChangeEvent) Event callback

Returns

Type Description
Disposable The destroyer of the event callback can place the object in the context.subscriptions array of the extension. When the extension is uninstalled, the event callback will be automatically cancelled.

Example

  1. let onDidChangeTextDocumentEventDispose = hx.workspace.onDidChangeTextDocument(function(event){
  2. let document = event.document;
  3. //do something with document.
  4. });

TextDocumentChangeEvent

An event describing a transactional document change.

Attribute list

Attribute name Type Description
document TextDocument The affected document.