diff --git a/package-lock.json b/package-lock.json index d2556a1..633a939 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "git-semantic-commit", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fd52f9f..d2998f6 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,8 @@ "test" ], "items": { - "type": "string" + "type": ["string", "object"], + "description": "Can be either a string, or an object. If an object, use type for the commit type, and description to give a short description for the particular commit type." }, "minItems": 1, "uniqueItems": true, diff --git a/src/commands/semantic-commit.ts b/src/commands/semantic-commit.ts index 9d602b3..45ee6f9 100644 --- a/src/commands/semantic-commit.ts +++ b/src/commands/semantic-commit.ts @@ -17,7 +17,7 @@ export class SemanticCommitCommand extends Command { context: ExtensionContext; scope: string; - types: string[]; + types: (string | {type: string, description: string})[]; constructor(context: ExtensionContext) { super(); @@ -110,13 +110,17 @@ export class SemanticCommitCommand extends Command { private createQuickPickItems(): QuickPickItem[] { const hasScope = this.hasScope(); - const typeItems = this.types.map(type => ({ - label: `$(git-commit) Commit with "${type}" type`, - alwaysShow: true, - actionType: ActionType.subject, - type, - description: '' - })); + const typeItems = this.types.map(item => { + const description = typeof item === "string" ? "" : item.description + const type = typeof item === "string" ? item : item.type + return ({ + label: `$(git-commit) Commit with "${type}" type`, + alwaysShow: true, + actionType: ActionType.subject, + type, + description + }) + }); return [ {