diff --git a/package.json b/package.json index 5efa4c3..37ef74e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "Other" ], "activationEvents": [ - "onView:main" + "onView:GitCherry.main" ], "main": "./out/extension.js", "contributes": { @@ -55,7 +55,7 @@ "views": { "GitCherry": [ { - "id": "main", + "id": "GitCherry.main", "name": "main", "icon": "resources/dark/cherry.svg" } @@ -63,7 +63,7 @@ }, "commands": [ { - "command": "pull_request", + "command": "GitCherry.pull_request", "title": "Create pull requests", "icon": { "light": "resources/light/start.svg", @@ -71,7 +71,7 @@ } }, { - "command": "refresh", + "command": "GitCherry.refresh", "title": "Refresh", "icon": { "light": "resources/light/refresh.svg", @@ -79,7 +79,7 @@ } }, { - "command": "continue", + "command": "GitCherry.continue", "title": "Continue cherry-picking", "icon": { "light": "resources/light/continue.svg", @@ -87,7 +87,7 @@ } }, { - "command": "cherry_pick", + "command": "GitCherry.cherry_pick", "title": "Cherry-pick", "icon": { "light": "resources/light/cherry.svg", @@ -95,7 +95,7 @@ } }, { - "command": "abort_cherry_pick", + "command": "GitCherry.abort_cherry_pick", "title": "Abort cherry-picking", "icon": { "light": "resources/light/abort.svg", @@ -106,29 +106,29 @@ "menus": { "view/title": [ { - "command": "pull_request", + "command": "GitCherry.pull_request", "group": "navigation", - "when": "view == main" + "when": "view == GitCherry.main" }, { - "command": "refresh", + "command": "GitCherry.refresh", "group": "navigation", - "when": "view == main" + "when": "view == GitCherry.main" }, { - "command": "continue", + "command": "GitCherry.continue", "group": "navigation", - "when": "view == main && isMergeConflict == true" + "when": "view == GitCherry.main && isMergeConflict == true" }, { - "command": "abort_cherry_pick", + "command": "GitCherry.abort_cherry_pick", "group": "navigation", - "when": "view == main && isMergeConflict == true" + "when": "view == GitCherry.main && isMergeConflict == true" }, { - "command": "cherry_pick", + "command": "GitCherry.cherry_pick", "group": "navigation", - "when": "view == main && isMergeConflict == false" + "when": "view == GitCherry.main && isMergeConflict == false" } ] } diff --git a/src/extension.ts b/src/extension.ts index a0aede0..93f7471 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -9,10 +9,10 @@ export async function activate () { await Git.init(); await GithubClient.init(); - window.registerTreeDataProvider('main', treeDataProvider); - commands.registerCommand('pull_request', () => Action.onPullRequest(treeDataProvider)); - commands.registerCommand('cherry_pick', () => Action.onCherryPick(treeDataProvider)); - commands.registerCommand('refresh', () => Action.onRefresh(treeDataProvider)); - commands.registerCommand('continue', () => Action.onContinue()); - commands.registerCommand('abort_cherry_pick', () => Action.onAbortCherryPick()); + window.registerTreeDataProvider('GitCherry.main', treeDataProvider); + commands.registerCommand('GitCherry.pull_request', () => Action.onPullRequest(treeDataProvider)); + commands.registerCommand('GitCherry.cherry_pick', () => Action.onCherryPick(treeDataProvider)); + commands.registerCommand('GitCherry.refresh', () => Action.onRefresh(treeDataProvider)); + commands.registerCommand('GitCherry.continue', () => Action.onContinue()); + commands.registerCommand('GitCherry.abort_cherry_pick', () => Action.onAbortCherryPick()); } diff --git a/src/tree/dataProvider.ts b/src/tree/dataProvider.ts index 308733f..5b59c60 100644 --- a/src/tree/dataProvider.ts +++ b/src/tree/dataProvider.ts @@ -7,7 +7,7 @@ export default class TreeDataProvider implements vscode.TreeDataProvider this.onItemClicked(element)); + commands.registerCommand('GitCherry.treeView.selectTreeItem', (element) => this.onItemClicked(element)); } getSelectedUpstreams (): string[] { @@ -34,7 +34,7 @@ export default class TreeDataProvider implements vscode.TreeDataProvider { element.setIcon(); - element.command = { command: 'treeView.selectTreeItem', title: 'Select item', arguments: [element] }; + element.command = { command: 'GitCherry.treeView.selectTreeItem', title: 'Select item', arguments: [element] }; return element; }