diff --git a/src/commands.ts b/src/commands.ts index a48eeb16f0..4ba3b287a3 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -291,6 +291,11 @@ export namespace Commands { export const GET_WORKSPACE_PATH = '_java.workspace.path'; + /** + * Update the gradle wrapper version for the given project + * client-side & server-side commands + */ + export const UPGRADE_GRADLE_WRAPPER_CMD = 'java.project.upgradeGradle.command'; export const UPGRADE_GRADLE_WRAPPER = 'java.project.upgradeGradle'; export const LOMBOK_CONFIGURE = "java.lombokConfigure"; diff --git a/src/extension.ts b/src/extension.ts index 5fbe033e47..509546f32c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -170,6 +170,7 @@ export function activate(context: ExtensionContext): Promise { actionableRuntimeNotificationSupport: true, onCompletionItemSelectedCommand: "editor.action.triggerParameterHints", extractInterfaceSupport: true, + advancedUpgradeGradleSupport: true, }, triggerFiles, }, diff --git a/src/gradle/gradleCodeActionProvider.ts b/src/gradle/gradleCodeActionProvider.ts index f3cb6b0f7f..d09af47046 100644 --- a/src/gradle/gradleCodeActionProvider.ts +++ b/src/gradle/gradleCodeActionProvider.ts @@ -41,7 +41,7 @@ export class GradleCodeActionProvider implements CodeActionProvider const projectUri = Uri.file(projectPath).toString(); const upgradeWrapperCommand: Command = { title: UPGRADE_GRADLE_WRAPPER_TITLE, - command: Commands.UPGRADE_GRADLE_WRAPPER, + command: Commands.UPGRADE_GRADLE_WRAPPER_CMD, arguments: [projectUri] }; const codeAction = new CodeAction(UPGRADE_GRADLE_WRAPPER_TITLE, CodeActionKind.QuickFix.append("gradle")); diff --git a/src/standardLanguageClient.ts b/src/standardLanguageClient.ts index ee753697e5..543d00a783 100644 --- a/src/standardLanguageClient.ts +++ b/src/standardLanguageClient.ts @@ -559,7 +559,7 @@ export class StandardLanguageClient { } })); - context.subscriptions.push(commands.registerCommand(Commands.UPGRADE_GRADLE_WRAPPER, (projectUri: string, version?: string) => { + context.subscriptions.push(commands.registerCommand(Commands.UPGRADE_GRADLE_WRAPPER_CMD, (projectUri: string, version?: string) => { upgradeGradle(projectUri, version); }));