diff --git a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItemCommand.ts b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts similarity index 69% rename from vscode/microsoft-kiota/src/commands/deleteWorkspaceItemCommand.ts rename to vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts index 5228b8556b..3bbf73fe44 100644 --- a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItemCommand.ts +++ b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts @@ -1,14 +1,14 @@ import * as vscode from "vscode"; -import * as rpc from "vscode-jsonrpc/node"; import TelemetryReporter from "@vscode/extension-telemetry"; -import { extensionId } from "../constants"; -import { connectToKiota, getLogEntriesForLevel, KiotaLogEntry, LogLevel } from "../kiotaInterop"; -import { WorkspaceTreeItem, WorkspaceTreeProvider } from "../providers/workspaceTreeProvider"; -import { isPluginType } from "../util"; -import { exportLogsAndShowErrors } from "../utilities/logging"; -import { Command } from "./Command"; -import { checkForSuccess } from "./generate/generation-util"; +import { extensionId } from "../../constants"; +import { getLogEntriesForLevel, KiotaLogEntry, LogLevel } from "../../kiotaInterop"; +import { WorkspaceTreeItem, WorkspaceTreeProvider } from "../../providers/workspaceTreeProvider"; +import { isPluginType } from "../../util"; +import { exportLogsAndShowErrors } from "../../utilities/logging"; +import { Command } from "../Command"; +import { checkForSuccess } from "../generate/generation-util"; +import { removeClient, removePlugin } from "./removeItem"; export class DeleteWorkspaceItemCommand extends Command { constructor(private _context: vscode.ExtensionContext, private _workspaceTreeProvider: WorkspaceTreeProvider) { @@ -92,30 +92,3 @@ export class DeleteWorkspaceItemCommand extends Command { } } -export function removePlugin(context: vscode.ExtensionContext, pluginName: string, cleanOutput: boolean): Promise { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType2( - "RemovePlugin" - ); - const result = await connection.sendRequest( - request, - pluginName, - cleanOutput - ); - return result; - }); -}; - -export function removeClient(context: vscode.ExtensionContext, clientName: string, cleanOutput: boolean): Promise { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType2( - "RemoveClient" - ); - const result = await connection.sendRequest( - request, - clientName, - cleanOutput - ); - return result; - }); -}; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts new file mode 100644 index 0000000000..8b906d30e9 --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts @@ -0,0 +1,32 @@ +import * as vscode from "vscode"; +import * as rpc from "vscode-jsonrpc/node"; + +import { connectToKiota, KiotaLogEntry } from "../../kiotaInterop"; + +export function removePlugin(context: vscode.ExtensionContext, pluginName: string, cleanOutput: boolean): Promise { + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType2( + "RemovePlugin" + ); + const result = await connection.sendRequest( + request, + pluginName, + cleanOutput + ); + return result; + }); +}; + +export function removeClient(context: vscode.ExtensionContext, clientName: string, cleanOutput: boolean): Promise { + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType2( + "RemoveClient" + ); + const result = await connection.sendRequest( + request, + clientName, + cleanOutput + ); + return result; + }); +}; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index a379dbedc0..7428af4906 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -4,7 +4,7 @@ import TelemetryReporter from '@vscode/extension-telemetry'; import * as vscode from "vscode"; import { CloseDescriptionCommand } from './commands/closeDescriptionCommand'; -import { DeleteWorkspaceItemCommand } from './commands/deleteWorkspaceItemCommand'; +import { DeleteWorkspaceItemCommand } from './commands/deleteWorkspaceItem/deleteWorkspaceItemCommand'; import { EditPathsCommand } from './commands/editPathsCommand'; import { GenerateClientCommand } from './commands/generate/generateClientCommand'; import { displayGenerationResults } from './commands/generate/generation-util';