Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove post-generation error popup #5989

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading