Skip to content

Commit

Permalink
isolate in folder
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Nov 19, 2024
1 parent 0a6763f commit a104372
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -92,30 +92,3 @@ export class DeleteWorkspaceItemCommand extends Command {
}
}

export function removePlugin(context: vscode.ExtensionContext, pluginName: string, cleanOutput: boolean): Promise<KiotaLogEntry[] | undefined> {
return connectToKiota(context, async (connection) => {
const request = new rpc.RequestType2<string, boolean, KiotaLogEntry[], void>(
"RemovePlugin"
);
const result = await connection.sendRequest(
request,
pluginName,
cleanOutput
);
return result;
});
};

export function removeClient(context: vscode.ExtensionContext, clientName: string, cleanOutput: boolean): Promise<KiotaLogEntry[] | undefined> {
return connectToKiota(context, async (connection) => {
const request = new rpc.RequestType2<string, boolean, KiotaLogEntry[], void>(
"RemoveClient"
);
const result = await connection.sendRequest(
request,
clientName,
cleanOutput
);
return result;
});
};
Original file line number Diff line number Diff line change
@@ -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<KiotaLogEntry[] | undefined> {
return connectToKiota(context, async (connection) => {
const request = new rpc.RequestType2<string, boolean, KiotaLogEntry[], void>(
"RemovePlugin"
);
const result = await connection.sendRequest(
request,
pluginName,
cleanOutput
);
return result;
});
};

export function removeClient(context: vscode.ExtensionContext, clientName: string, cleanOutput: boolean): Promise<KiotaLogEntry[] | undefined> {
return connectToKiota(context, async (connection) => {
const request = new rpc.RequestType2<string, boolean, KiotaLogEntry[], void>(
"RemoveClient"
);
const result = await connection.sendRequest(
request,
clientName,
cleanOutput
);
return result;
});
};
2 changes: 1 addition & 1 deletion vscode/microsoft-kiota/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit a104372

Please sign in to comment.