From 276fdef5ed2ad56ca0796487649d72c1aea59cfb Mon Sep 17 00:00:00 2001 From: ElinorW Date: Thu, 13 Jun 2024 13:14:53 +0300 Subject: [PATCH] declare lockfile constant --- .../microsoft-kiota/src/openApiTreeProvider.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vscode/microsoft-kiota/src/openApiTreeProvider.ts b/vscode/microsoft-kiota/src/openApiTreeProvider.ts index eca76367ee..cbd12c7579 100644 --- a/vscode/microsoft-kiota/src/openApiTreeProvider.ts +++ b/vscode/microsoft-kiota/src/openApiTreeProvider.ts @@ -13,7 +13,7 @@ import { KiotaOpenApiNode, KiotaShowConfiguration, KiotaShowResult, - LockFile, + ConfigurationFile, PluginObjectProperties } from './kiotaInterop'; import { ExtensionSettings } from './extensionSettings'; import { treeViewId } from './constants'; @@ -31,7 +31,7 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider = {}; + private _lockFile?: ConfigurationFile | Partial = {}; public get isLockFileLoaded(): boolean { return !!this._lockFile; } @@ -39,10 +39,10 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider = { version: parsedLockFile.version }; + let filteredData: Partial = { version: parsedLockFile.version }; if (parsedLockFile.clients && parsedLockFile.clients[clientOrPluginName]) { filteredData.clients = { @@ -56,7 +56,7 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider { this.closeDescription(false); - this._lockFile = { version: '1.0.0', clients: {}, plugins: {} }; + const newLockFile: ConfigurationFile = { version: '1.0.0', clients: {}, plugins: {} }; if ((clientObject as ClientObjectProperties).clientNamespaceName) { - this._lockFile.clients![clientOrPluginKey] = clientObject as ClientObjectProperties; + newLockFile.clients![clientOrPluginKey] = clientObject as ClientObjectProperties; } else { - this._lockFile.plugins![clientOrPluginKey] = clientObject as PluginObjectProperties; + newLockFile.plugins![clientOrPluginKey] = clientObject as PluginObjectProperties; } - + this._lockFile = newLockFile; if (clientObject.descriptionLocation) { this._descriptionUrl = clientObject.descriptionLocation; this.includeFilters = clientObject.includePatterns;