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

ui: Add submenu for Maven and Gradle #664

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 29 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,39 @@
"group": "inline"
},
{
"command": "java.project.update",
"when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+uri\\b)(?=.*?\\b\\+(maven|gradle)\\b)/",
"submenu": "javaProject.maven",
"when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+uri\\b)(?=.*?\\b\\+(maven)\\b)/",
"group": "9_configuration@10"
},
{
"submenu": "javaProject.gradle",
"when": "view == javaProjectExplorer && viewItem =~ /java:project(?=.*?\\b\\+uri\\b)(?=.*?\\b\\+(gradle)\\b)/",
"group": "9_configuration@10"
}
],
"javaProject.maven": [
{
"command": "java.project.update",
"group": "maven@10"
}
],
"javaProject.gradle": [
{
"command": "java.project.update",
"group": "gradle@10"
}
]
},
"submenus": [
{
"id": "javaProject.maven",
"label": "Maven"
},
{
"id": "javaProject.gradle",
"label": "Gradle"
}
],
"views": {
"explorer": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"contributes.commands.java.view.package.refresh": "Refresh",
"contributes.commands.java.project.build.workspace": "Rebuild All",
"contributes.commands.java.project.clean.workspace": "Clean Workspace",
"contributes.commands.java.project.update": "Update Project",
"contributes.commands.java.project.rebuild": "Rebuild Project",
"contributes.commands.java.project.update": "Reload Project",
"contributes.commands.java.view.package.revealInProjectExplorer": "Reveal in Java Project Explorer",
"contributes.commands.java.view.package.changeToFlatPackageView":"Flat View",
"contributes.commands.java.view.package.changeToHierarchicalPackageView":"Hierarchical View",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"contributes.commands.java.view.package.refresh": "刷新",
"contributes.commands.java.project.build.workspace": "重新构建所有项目",
"contributes.commands.java.project.clean.workspace": "清理工作空间",
"contributes.commands.java.project.update": "更新项目",
"contributes.commands.java.project.rebuild": "重新构建项目",
"contributes.commands.java.project.update": "重新加载项目",
"contributes.commands.java.view.package.revealInProjectExplorer": "在 Java 项目视图中显示",
"contributes.commands.java.view.package.changeToFlatPackageView":"平行显示",
"contributes.commands.java.view.package.changeToHierarchicalPackageView":"层级显示",
Expand Down
3 changes: 2 additions & 1 deletion src/views/dependencyDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export class DependencyDataProvider implements TreeDataProvider<ExplorerNode> {
commands.executeCommand(Commands.JAVA_CLEAN_WORKSPACE)));
context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_PROJECT_UPDATE, async (node: INodeData) => {
if (!node.uri) {
window.showErrorMessage("The URI of the project is not available, you can try to update the project by right clicking the project configuration file (pom.xml or *.gradle) from the File Explorer.");
sendError(new Error("Uri not available when reloading project"));
window.showErrorMessage("The URI of the project is not available, you can try to trigger the command 'Java: Reload Project' from Command Palette.");
return;
}
const pattern: RelativePattern = new RelativePattern(Uri.parse(node.uri).fsPath, "{pom.xml,*.gradle}");
Expand Down