Skip to content

Commit

Permalink
Add icons in status bar to browse repository and see file history
Browse files Browse the repository at this point in the history
  • Loading branch information
pmiossec committed Nov 16, 2017
1 parent b476373 commit 1848bf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
19 changes: 1 addition & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,7 @@
},
"categories": ["Other"],
"activationEvents": [
"onCommand:extension.gitextensions.blame",
"onCommand:extension.gitextensions.branch",
"onCommand:extension.gitextensions.browse",
"onCommand:extension.gitextensions.commit",
"onCommand:extension.gitextensions.checkoutbranch",
"onCommand:extension.gitextensions.checkoutrevision",
"onCommand:extension.gitextensions.difftool",
"onCommand:extension.gitextensions.filehistory",
"onCommand:extension.gitextensions.init",
"onCommand:extension.gitextensions.mergetool",
"onCommand:extension.gitextensions.pull",
"onCommand:extension.gitextensions.push",
"onCommand:extension.gitextensions.reset",
"onCommand:extension.gitextensions.settings",
"onCommand:extension.gitextensions.stash",
"onCommand:extension.gitextensions.synchronize",
"onCommand:extension.gitextensions.tag",
"onCommand:extension.gitextensions.remotes"
"*"
],
"main": "./out/extension",
"contributes": {
Expand Down
14 changes: 13 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
import * as vscode from "vscode";
import * as child from "child_process";
import { window } from "vscode";
import { window, StatusBarAlignment } from "vscode";

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

const statusHistory = window.createStatusBarItem(vscode.StatusBarAlignment.Right, 500);
statusHistory.command = 'extension.gitextensions.filehistory';
statusHistory.text = '$(history)';
statusHistory.tooltip = 'See current file history in GitExtensions';
statusHistory.show();

const statusBrowse = window.createStatusBarItem(vscode.StatusBarAlignment.Right, 500);
statusBrowse.command = 'extension.gitextensions.browse';
statusBrowse.text = '$(git-branch)';
statusBrowse.tooltip = 'Browse repository in GitExtensions';
statusBrowse.show();

// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
Expand Down

0 comments on commit 1848bf7

Please sign in to comment.