Skip to content

Commit 5628416

Browse files
committed
clarify docs for onDidCloseTextDocument
1 parent 35430ea commit 5628416

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9274,9 +9274,11 @@ declare module 'vscode' {
92749274
* An event that is emitted when a [text document](#TextDocument) is disposed or when the language id
92759275
* of a text document [has been changed](#languages.setTextDocumentLanguage).
92769276
*
9277-
* To add an event listener when a visible text document is closed, use the [TextEditor](#TextEditor) events in the
9278-
* [window](#window) namespace. Note that this event is not emitted when a [TextEditor](#TextEditor) is closed
9279-
* but the document remains open in another [visible text editor](#window.visibleTextEditors).
9277+
* *Note 1:* There is no guarantee that this event fires when an editor tab is closed, use the
9278+
* [`onDidChangeVisibleTextEditors`](#window.onDidChangeVisibleTextEditors)-event to know when editors change.
9279+
*
9280+
* *Note 2:* A document can be open but not shown in an editor which means this event can fire
9281+
* for a document that has not been shown in an editor.
92809282
*/
92819283
export const onDidCloseTextDocument: Event<TextDocument>;
92829284

0 commit comments

Comments
 (0)