Skip to content

Commit

Permalink
Fix: Remove post-generation error popup (#5989)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome authored Jan 13, 2025
1 parent bd107af commit ceabce9
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import * as vscode from "vscode";
import * as fs from 'fs';

import { KIOTA_WORKSPACE_FILE, treeViewId } from "../../constants";
import { OpenApiTreeProvider } from "../../providers/openApiTreeProvider";
import { updateTreeViewIcons } from "../../util";
import { getWorkspaceJsonPath, updateTreeViewIcons } from "../../util";

export async function displayGenerationResults(openApiTreeProvider: OpenApiTreeProvider, config: any) {
const clientNameOrPluginName = config.clientClassName || config.pluginName;
const workspaceJson = vscode.workspace.textDocuments.find(doc => doc.fileName.endsWith(KIOTA_WORKSPACE_FILE));
if (workspaceJson) {
const content = workspaceJson.getText();
const content = await fs.promises.readFile(getWorkspaceJsonPath(), 'utf-8');
const workspace = JSON.parse(content);
const clientOrPluginObject = workspace.plugins[clientNameOrPluginName] || workspace.clients[clientNameOrPluginName];
await openApiTreeProvider.loadEditPaths(clientNameOrPluginName, clientOrPluginObject);
if (clientOrPluginObject) {
await openApiTreeProvider.loadEditPaths(clientNameOrPluginName, clientOrPluginObject);
}
}
openApiTreeProvider.resetInitialState();
await updateTreeViewIcons(treeViewId, false, true);
Expand Down

0 comments on commit ceabce9

Please sign in to comment.