mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +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();
|
super();
|
||||||
this._registration = this._register(new ConditionalRegistration(register));
|
this._registration = this._register(new ConditionalRegistration(register));
|
||||||
vscode.window.onDidChangeActiveTextEditor(this.update, this, this._disposables);
|
vscode.window.onDidChangeActiveTextEditor(this.update, this, this._disposables);
|
||||||
|
vscode.workspace.onDidOpenTextDocument(this.onDidOpenDocument, this, this._disposables);
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,6 +153,13 @@ export class ActiveDocumentDependentRegistration extends Disposable {
|
|||||||
const enabled = !!(editor && vscode.languages.match(this.selector, editor.document));
|
const enabled = !!(editor && vscode.languages.match(this.selector, editor.document));
|
||||||
this._registration.update(enabled);
|
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(
|
export function register(
|
||||||
|
|||||||
Reference in New Issue
Block a user