Skip to content

Commit

Permalink
Clear the active selected build tool where a project supports multiple.
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed Apr 15, 2024
1 parent 7feba45 commit 34f54ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/buildFilesSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ExtensionContext, MessageItem, QuickPickItem, QuickPickItemKind, Uri, W
import { convertToGlob, getExclusionGlob, getInclusionPatternsFromNegatedExclusion } from "./utils";
import * as path from "path";
import { IBuildTool, getContributedBuildTools } from "./plugin";
import { ACTIVE_BUILD_TOOL_STATE } from "./settings";

export const PICKED_BUILD_FILES = "java.pickedBuildFiles";
export const BUILD_TOOL_FOR_CONFLICTS = "java.buildToolForConflicts";
Expand Down Expand Up @@ -293,8 +294,9 @@ interface IBuildFilePicker extends QuickPickItem {
buildToolAndUri: Map<IBuildTool, Uri>;
}

export function cleanupProjectPickerCache(context: ExtensionContext) {
export function cleanupWorkspaceState(context: ExtensionContext) {
context.workspaceState.update(PICKED_BUILD_FILES, undefined);
context.workspaceState.update(BUILD_TOOL_FOR_CONFLICTS, undefined);
context.workspaceState.update(IMPORT_METHOD, undefined);
context.workspaceState.update(ACTIVE_BUILD_TOOL_STATE, undefined);
}
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { getMessage } from './errorUtils';
import { TelemetryService } from '@redhat-developer/vscode-redhat-telemetry/lib';
import { activationProgressNotification } from "./serverTaskPresenter";
import { loadSupportedJreNames } from './jdkUtils';
import { BuildFileSelector, PICKED_BUILD_FILES, cleanupProjectPickerCache } from './buildFilesSelector';
import { BuildFileSelector, PICKED_BUILD_FILES, cleanupWorkspaceState } from './buildFilesSelector';
import { pasteFile } from './pasteAction';
import { ServerStatusKind } from './serverStatus';

Expand Down Expand Up @@ -345,7 +345,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
const data = {};
try {
cleanupLombokCache(context);
cleanupProjectPickerCache(context);
cleanupWorkspaceState(context);
deleteDirectory(workspacePath);
deleteDirectory(syntaxServerWorkspacePath);
} catch (error) {
Expand Down

0 comments on commit 34f54ac

Please sign in to comment.