Skip to content

Commit e63055e

Browse files
authored
Enable run azd init from a Maven project's pom file on right click (#4851)
* enable run azd init from a Maven project's pom file on right click * change the title of running azd init * hide from the command palette
1 parent 630b001 commit e63055e

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

ext/vscode/package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
"command": "azure-dev.commands.cli.init",
3939
"title": "%azure-dev.commands.cli.init.title%"
4040
},
41+
{
42+
"category": "%azure-dev.commands_category%",
43+
"command": "azure-dev.commands.cli.initFromPom",
44+
"title": "%azure-dev.commands.cli.initFromPom.title%"
45+
},
4146
{
4247
"category": "%azure-dev.commands_category%",
4348
"command": "azure-dev.commands.cli.provision",
@@ -165,6 +170,10 @@
165170
},
166171
"menus": {
167172
"commandPalette": [
173+
{
174+
"command": "azure-dev.commands.cli.initFromPom",
175+
"when": "false"
176+
},
168177
{
169178
"command": "azure-dev.commands.getDotEnvFilePath",
170179
"when": "false"
@@ -185,11 +194,16 @@
185194
"explorer/context": [
186195
{
187196
"submenu": "azure-dev.explorer.submenu",
188-
"when": "resourceFilename =~ /azure.yaml/i",
197+
"when": "resourceFilename =~ /(azure.yaml|pom.xml)/i",
189198
"group": "azure-dev"
190199
}
191200
],
192201
"azure-dev.explorer.submenu": [
202+
{
203+
"when": "resourceFilename =~ /pom.xml/i",
204+
"command": "azure-dev.commands.cli.initFromPom",
205+
"group": "10provision@10"
206+
},
193207
{
194208
"when": "resourceFilename =~ /azure.yaml/i",
195209
"command": "azure-dev.commands.cli.provision",

ext/vscode/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"azure-dev.commands_category": "Azure Developer CLI (azd)",
33

44
"azure-dev.commands.cli.init.title": "Initialize App (init)",
5+
"azure-dev.commands.cli.initFromPom.title": "Initialize for Azure (init)",
56
"azure-dev.commands.cli.provision.title": "Provision Azure Resources (provision)",
67
"azure-dev.commands.cli.deploy.title": "Deploy to Azure (deploy)",
78
"azure-dev.commands.cli.restore.title": "Restore App Dependencies (restore)",

ext/vscode/src/commands/registerCommands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { disableDevCenterMode, enableDevCenterMode } from './devCenterMode';
2222

2323
export function registerCommands(): void {
2424
registerActivityCommand('azure-dev.commands.cli.init', init);
25+
registerActivityCommand('azure-dev.commands.cli.initFromPom', init);
2526
registerActivityCommand('azure-dev.commands.cli.provision', provision);
2627
registerActivityCommand('azure-dev.commands.cli.deploy', deploy);
2728
registerActivityCommand('azure-dev.commands.cli.restore', restore);

0 commit comments

Comments
 (0)