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: "Override" message only displays if there's a change on the tree #4899

Merged
merged 4 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions vscode/microsoft-kiota/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export async function activate(
{
await checkForSuccess(result);
openApiTreeProvider.refreshView();
openApiTreeProvider.setSelectionChanged(false);
await loadLockFile({fsPath: workspaceJsonPath}, openApiTreeProvider, config.pluginName);
await updateTreeViewIcons(treeViewId, false, true);
await exportLogsAndShowErrors(result);
Expand Down Expand Up @@ -344,6 +345,7 @@ export async function activate(
{
await checkForSuccess(result);
openApiTreeProvider.refreshView();
openApiTreeProvider.setSelectionChanged(false);
await loadLockFile({fsPath: workspaceJsonPath}, openApiTreeProvider, config.pluginName);
await updateTreeViewIcons(treeViewId, false, true);
await exportLogsAndShowErrors(result);
Expand Down Expand Up @@ -415,6 +417,7 @@ export async function activate(
{
await checkForSuccess(result);
openApiTreeProvider.refreshView();
openApiTreeProvider.setSelectionChanged(false);
await loadLockFile({fsPath: workspaceJsonPath}, openApiTreeProvider, config.clientClassName);
await updateTreeViewIcons(treeViewId, false, true);
await exportLogsAndShowErrors(result);
Expand Down
8 changes: 4 additions & 4 deletions vscode/microsoft-kiota/src/openApiTreeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider<OpenApiTreeN
public hasSelectionChanged(): boolean {
return this.selectionChanged;
}
public setSelectionChanged() {
this.selectionChanged = true;
public setSelectionChanged(state: boolean) {
this.selectionChanged = state;
}
public async setDescriptionUrl(descriptionUrl: string): Promise<void> {
this.closeDescription(false);
Expand All @@ -196,7 +196,7 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider<OpenApiTreeN
}
private selectInternal(apiNode: KiotaOpenApiNode, selected: boolean, recursive: boolean) {
apiNode.selected = selected;
this.setSelectionChanged();
this.setSelectionChanged(true);
const isOperationNode = apiNode.isOperation ?? false;
if (recursive) {
apiNode.children.forEach(x => this.selectInternal(x, selected, recursive));
Expand All @@ -206,7 +206,7 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider<OpenApiTreeN
const parent = this.findApiNode(getPathSegments(trimOperation(apiNode.path)), this.rawRootNode);
if (parent) {
parent.selected = selected;
this.setSelectionChanged();
this.setSelectionChanged(true);
}
}
}
Expand Down
Loading