This commit is contained in:
Yan Zhang 2017-12-04 15:35:41 +08:00
Родитель 158389ba5b
Коммит e33f6703f1
3 изменённых файлов: 20 добавлений и 9 удалений

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

@ -24,7 +24,19 @@
"activationEvents": [
"workspaceContains:pom.xml",
"onCommand:maven.projects.refresh",
"onCommand:maven.archetype.generate",
"onCommand:maven.goal.clean",
"onCommand:maven.goal.validate",
"onCommand:maven.goal.compile",
"onCommand:maven.goal.test",
"onCommand:maven.goal.package",
"onCommand:maven.goal.verify",
"onCommand:maven.goal.install",
"onCommand:maven.goal.site",
"onCommand:maven.goal.deploy",
"onCommand:maven.goal.custom",
"onCommand:maven.project.effectivePom",
"onCommand:maven.project.pinProject",
"onCommand:maven.project.openPom",
"onView:mavenProjects"
],
"main": "./out/extension",
@ -39,11 +51,6 @@
"dark": "resources/dark/refresh.svg"
}
},
{
"command": "maven.goal.exec",
"title": "Execute",
"category": "Maven"
},
{
"command": "maven.goal.clean",
"title": "clean",

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

@ -107,7 +107,8 @@ export class ProjectDataProvider implements vscode.TreeDataProvider<vscode.TreeI
}
}
public async effectivePom(item: ProjectItem | any): Promise<void> {
public async effectivePom(projectItem: ProjectItem | any): Promise<void> {
const item = projectItem || await VSCodeUI.getQuickPick<ProjectItem>(this.cachedItems, (x) => x.label, (x) => x.pomXmlFilePath);
const pomXmlFilePath = item.fsPath || item.pomXmlFilePath;
const p = new Promise<string>((resolve, reject) => {
const filepath = Utils.getEffectivePomOutputPath(pomXmlFilePath);
@ -130,7 +131,8 @@ export class ProjectDataProvider implements vscode.TreeDataProvider<vscode.TreeI
}
}
public async customGoal(item: ProjectItem): Promise<void> {
public async customGoal(projectItem: ProjectItem): Promise<void> {
const item = projectItem || await VSCodeUI.getQuickPick<ProjectItem>(this.cachedItems, (x) => x.label, (x) => x.pomXmlFilePath);
const cmdlist: string[] = Utils.loadCmdHistory(item.pomXmlFilePath);
const selectedGoal = await vscode.window.showQuickPick(cmdlist.concat([ENTRY_NEW_GOALS, ENTRY_OPEN_HIST]), {
placeHolder: "Select the custom command ... ",

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

@ -37,7 +37,9 @@ export function activate(context: vscode.ExtensionContext) {
}));
context.subscriptions.push(vscode.commands.registerCommand("maven.project.openPom", (item) => {
VSCodeUI.openFileIfExists(item.pomXmlFilePath);
if (item) {
VSCodeUI.openFileIfExists(item.pomXmlFilePath);
}
}));
context.subscriptions.push(vscode.commands.registerCommand("maven.archetype.generate", (entry) => {