From f99bccfba2df3b3988611dd4c3879f5a17df6654 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Wed, 20 Sep 2023 16:54:10 +0800 Subject: [PATCH] Merge refresh and reload project commands Signed-off-by: Sheng Chen --- package.json | 5 ----- src/extension.ts | 14 +++++++++----- test/projects/maven/.vscode/tasks.json | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 063cf4a7..f614fda4 100644 --- a/package.json +++ b/package.json @@ -422,11 +422,6 @@ "command": "maven.archetype.generate", "when": "view == mavenProjects", "group": "navigation@1" - }, - { - "command": "maven.explorer.refresh", - "when": "view == mavenProjects", - "group": "overflow@2" } ], "view/item/context": [ diff --git a/src/extension.ts b/src/extension.ts index 61a61aeb..eb3c74fa 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -160,14 +160,18 @@ async function doActivate(_operationId: string, context: vscode.ExtensionContext } } }); + + registerCommand(context, "maven.java.projectConfiguration.update", () => { + MavenExplorerProvider.getInstance().refresh(); + if (isJavaExtEnabled()) { + // Reload All Maven Projects in JDTLS, impl in upstream + vscode.commands.executeCommand("java.projectConfiguration.update", MavenProjectManager.projects.map(n => Uri.file(n.pomPath))); + } + }); + // register artifact searcher if Java language server is activated if (isJavaExtEnabled()) { registerArtifactSearcher(context); - - // Reload All Maven Projects in JDTLS, impl in upstream - registerCommand(context, "maven.java.projectConfiguration.update", () => { - vscode.commands.executeCommand("java.projectConfiguration.update", MavenProjectManager.projects.map(n => Uri.file(n.pomPath))); - }) } // diagnostic diff --git a/test/projects/maven/.vscode/tasks.json b/test/projects/maven/.vscode/tasks.json index a26671f3..dcff3e16 100644 --- a/test/projects/maven/.vscode/tasks.json +++ b/test/projects/maven/.vscode/tasks.json @@ -2,7 +2,7 @@ "version": "2.0.0", "tasks": [ { - "type": "java", + "type": "java (buildArtifact)", "label": "java: exportjar:maven", "mainClass": "com.mycompany.app.App", "targetPath": "${workspaceFolder}/${workspaceFolderBasename}.jar",