Skip to content

Commit 7e7dfa9

Browse files
authored
Separate java.project.upgradeGradle client and server command (#3014)
* fix duplicate gradle upgrade command * add advancedUpgradeGradleSupport capability Signed-off-by: Shi Chen <[email protected]>
1 parent f43dc66 commit 7e7dfa9

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/commands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,11 @@ export namespace Commands {
291291

292292
export const GET_WORKSPACE_PATH = '_java.workspace.path';
293293

294+
/**
295+
* Update the gradle wrapper version for the given project
296+
* client-side & server-side commands
297+
*/
298+
export const UPGRADE_GRADLE_WRAPPER_CMD = 'java.project.upgradeGradle.command';
294299
export const UPGRADE_GRADLE_WRAPPER = 'java.project.upgradeGradle';
295300

296301
export const LOMBOK_CONFIGURE = "java.lombokConfigure";

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
173173
actionableRuntimeNotificationSupport: true,
174174
onCompletionItemSelectedCommand: "editor.action.triggerParameterHints",
175175
extractInterfaceSupport: true,
176+
advancedUpgradeGradleSupport: true,
176177
},
177178
triggerFiles,
178179
},

src/gradle/gradleCodeActionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class GradleCodeActionProvider implements CodeActionProvider<CodeAction>
4141
const projectUri = Uri.file(projectPath).toString();
4242
const upgradeWrapperCommand: Command = {
4343
title: UPGRADE_GRADLE_WRAPPER_TITLE,
44-
command: Commands.UPGRADE_GRADLE_WRAPPER,
44+
command: Commands.UPGRADE_GRADLE_WRAPPER_CMD,
4545
arguments: [projectUri]
4646
};
4747
const codeAction = new CodeAction(UPGRADE_GRADLE_WRAPPER_TITLE, CodeActionKind.QuickFix.append("gradle"));

src/standardLanguageClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ export class StandardLanguageClient {
571571
}
572572
}));
573573

574-
context.subscriptions.push(commands.registerCommand(Commands.UPGRADE_GRADLE_WRAPPER, (projectUri: string, version?: string) => {
574+
context.subscriptions.push(commands.registerCommand(Commands.UPGRADE_GRADLE_WRAPPER_CMD, (projectUri: string, version?: string) => {
575575
upgradeGradle(projectUri, version);
576576
}));
577577

0 commit comments

Comments
 (0)