TextDocumentWillSaveEvent

An event that is fired when a document will be saved.

To make modifications to the document before it is being saved, call the {@linkcode TextDocumentWillSaveEvent.waitUntil waitUntil}-function with a thenable that resolves to an array of text edits.

Online Documentation

Properties

Link copied to clipboard
abstract val document: TextDocument

The document that will be saved.

Link copied to clipboard

The reason why save was triggered.

Functions

Link copied to clipboard
abstract fun waitUntil(thenable: PromiseLike<ReadonlyArray<TextEdit>>)

Allows to pause the event loop and to apply pre-save-edits. Edits of subsequent calls to this function will be applied in order. The edits will be ignored if concurrent modifications of the document happened.

abstract fun waitUntil(thenable: PromiseLike<JsAny?>)

Allows to pause the event loop until the provided thenable resolved.