mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 11:49:38 +00:00
Make sure we update tag closing registration when the document's language changes
Fixes #67613
This commit is contained in:
@@ -144,6 +144,7 @@ export class ActiveDocumentDependentRegistration extends Disposable {
|
||||
super();
|
||||
this._registration = this._register(new ConditionalRegistration(register));
|
||||
vscode.window.onDidChangeActiveTextEditor(this.update, this, this._disposables);
|
||||
vscode.workspace.onDidOpenTextDocument(this.onDidOpenDocument, this, this._disposables);
|
||||
this.update();
|
||||
}
|
||||
|
||||
@@ -152,6 +153,13 @@ export class ActiveDocumentDependentRegistration extends Disposable {
|
||||
const enabled = !!(editor && vscode.languages.match(this.selector, editor.document));
|
||||
this._registration.update(enabled);
|
||||
}
|
||||
|
||||
private onDidOpenDocument(openedDocument: vscode.TextDocument) {
|
||||
if (vscode.window.activeTextEditor && vscode.window.activeTextEditor.document === openedDocument) {
|
||||
// The active document's language may have changed
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function register(
|
||||
|
||||
Reference in New Issue
Block a user