Skip to content

Commit 1848bf7

Browse files
committed
Add icons in status bar to browse repository and see file history
1 parent b476373 commit 1848bf7

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

package.json

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,7 @@
99
},
1010
"categories": ["Other"],
1111
"activationEvents": [
12-
"onCommand:extension.gitextensions.blame",
13-
"onCommand:extension.gitextensions.branch",
14-
"onCommand:extension.gitextensions.browse",
15-
"onCommand:extension.gitextensions.commit",
16-
"onCommand:extension.gitextensions.checkoutbranch",
17-
"onCommand:extension.gitextensions.checkoutrevision",
18-
"onCommand:extension.gitextensions.difftool",
19-
"onCommand:extension.gitextensions.filehistory",
20-
"onCommand:extension.gitextensions.init",
21-
"onCommand:extension.gitextensions.mergetool",
22-
"onCommand:extension.gitextensions.pull",
23-
"onCommand:extension.gitextensions.push",
24-
"onCommand:extension.gitextensions.reset",
25-
"onCommand:extension.gitextensions.settings",
26-
"onCommand:extension.gitextensions.stash",
27-
"onCommand:extension.gitextensions.synchronize",
28-
"onCommand:extension.gitextensions.tag",
29-
"onCommand:extension.gitextensions.remotes"
12+
"*"
3013
],
3114
"main": "./out/extension",
3215
"contributes": {

src/extension.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
import * as vscode from "vscode";
33
import * as child from "child_process";
4-
import { window } from "vscode";
4+
import { window, StatusBarAlignment } from "vscode";
55

66
const findWorkspaceFolder = () => {
77
const workspaceFolders = vscode.workspace.workspaceFolders;
@@ -50,6 +50,18 @@ export function activate(context: vscode.ExtensionContext) {
5050
// This line of code will only be executed once when your extension is activated
5151
console.log('Activing "vscode-gitextensions" extension.');
5252

53+
const statusHistory = window.createStatusBarItem(vscode.StatusBarAlignment.Right, 500);
54+
statusHistory.command = 'extension.gitextensions.filehistory';
55+
statusHistory.text = '$(history)';
56+
statusHistory.tooltip = 'See current file history in GitExtensions';
57+
statusHistory.show();
58+
59+
const statusBrowse = window.createStatusBarItem(vscode.StatusBarAlignment.Right, 500);
60+
statusBrowse.command = 'extension.gitextensions.browse';
61+
statusBrowse.text = '$(git-branch)';
62+
statusBrowse.tooltip = 'Browse repository in GitExtensions';
63+
statusBrowse.show();
64+
5365
// The command has been defined in the package.json file
5466
// Now provide the implementation of the command with registerCommand
5567
// The commandId parameter must match the command field in package.json

0 commit comments

Comments
 (0)