Add missing disposable registration (#198473)

This commit is contained in:
Matt Bierner 2023-11-16 14:18:43 -08:00 committed by GitHub
parent 4f1065bf12
commit 4f866533b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,16 +31,17 @@ const getFreshLensLocation = () => workspace.getConfiguration().get(Constants.Co
*/
export class NpmScriptLensProvider implements CodeLensProvider, Disposable {
private lensLocation = getFreshLensLocation();
private changeEmitter = new EventEmitter<void>();
private readonly changeEmitter = new EventEmitter<void>();
private subscriptions: Disposable[] = [];
/**
* @inheritdoc
*/
public onDidChangeCodeLenses = this.changeEmitter.event;
public readonly onDidChangeCodeLenses = this.changeEmitter.event;
constructor() {
this.subscriptions.push(
this.changeEmitter,
workspace.onDidChangeConfiguration(evt => {
if (evt.affectsConfiguration(Constants.ConfigKey)) {
this.lensLocation = getFreshLensLocation();