add shortcut to reload all maven projects (#847)

Signed-off-by: Yan Zhang <yanzh@microsoft.com>
This commit is contained in:
Yan Zhang 2022-07-21 17:32:17 +08:00 коммит произвёл GitHub
Родитель bf3467003c
Коммит 44ab06e5fa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 27 добавлений и 4 удалений

Просмотреть файл

@ -230,6 +230,12 @@
"command": "maven.favorites",
"title": "%contributes.commands.maven.favorites%",
"category": "Maven"
},
{
"command": "maven.java.projectConfiguration.update",
"title": "%contributes.commands.maven.java.projectConfiguration.update%",
"icon": "$(sync)",
"category": "Maven"
}
],
"views": {
@ -359,6 +365,10 @@
{
"command": "maven.goal.execute",
"when": "isWorkspaceTrusted"
},
{
"command": "maven.java.projectConfiguration.update",
"when": "false"
}
],
"explorer/context": [
@ -374,6 +384,11 @@
}
],
"view/title": [
{
"command": "maven.java.projectConfiguration.update",
"when": "view == mavenProjects && javaLSReady",
"group": "navigation@05"
},
{
"command": "maven.view.flat",
"when": "view == mavenProjects && config.maven.view != flat",
@ -392,7 +407,7 @@
{
"command": "maven.explorer.refresh",
"when": "view == mavenProjects",
"group": "navigation@2"
"group": "overflow@2"
}
],
"view/item/context": [

Просмотреть файл

@ -41,5 +41,6 @@
"configuration.maven.settingsFile": "Specifies the absolute path of your maven configuration file, the default value is ~/.m2/settings.xml",
"configuration.maven.dependency.enableConflictDiagnostics": "Specify whether to show diagnostics for conflict dependencies.",
"configuration.maven.projectOpenBehavior": "Default method of opening newly created project.",
"configuration.maven.explorer.projectName": "Format of project node name shown in Maven explorer."
"configuration.maven.explorer.projectName": "Format of project node name shown in Maven explorer.",
"contributes.commands.maven.java.projectConfiguration.update": "Reload All Maven Projects"
}

Просмотреть файл

@ -41,5 +41,6 @@
"configuration.maven.settingsFile": "指定 maven 配置文件的绝对路径, 默认是 ~/.m2/settings.xml",
"configuration.maven.dependency.enableConflictDiagnostics": "指定是否在 POM 文件中显示依赖冲突。",
"configuration.maven.projectOpenBehavior": "新建项目的默认打开方式。",
"configuration.maven.explorer.projectName": "Maven 项目名称的显示格式。"
"configuration.maven.explorer.projectName": "Maven 项目名称的显示格式。",
"contributes.commands.maven.java.projectConfiguration.update": "重新加载所有 Maven 项目"
}

Просмотреть файл

@ -41,5 +41,6 @@
"configuration.maven.settingsFile": "指定 maven 設定文件的絕對路徑,預設是 ~/.m2/settings.xml",
"configuration.maven.dependency.enableConflictDiagnostics": "指定是否在 POM 文件中顯示相依套件衝突。",
"configuration.maven.projectOpenBehavior": "新建專案的預設打開方式。",
"configuration.maven.explorer.projectName": "Maven 專案名稱節點的格式。"
"configuration.maven.explorer.projectName": "Maven 專案名稱節點的格式。",
"contributes.commands.maven.java.projectConfiguration.update": "重新載入所有 Maven 專案"
}

Просмотреть файл

@ -145,6 +145,11 @@ async function doActivate(_operationId: string, context: vscode.ExtensionContext
// 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", mavenExplorerProvider.mavenProjectNodes.map(n => Uri.file(n.pomPath)));
})
}
// diagnostic