mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-24 09:45:39 -05:00
Initial commit -- very basic blame support
This commit is contained in:
21
src/extension.ts
Normal file
21
src/extension.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
import {DocumentSelector, ExtensionContext, languages, workspace} from 'vscode';
|
||||
import GitCodeLensProvider from './codeLensProvider';
|
||||
import {gitRepoPath} from './git'
|
||||
|
||||
// this method is called when your extension is activated
|
||||
export function activate(context: ExtensionContext) {
|
||||
// Workspace not using a folder. No access to git repo.
|
||||
if (!workspace.rootPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
gitRepoPath(workspace.rootPath).then(repoPath => {
|
||||
let selector: DocumentSelector = { scheme: 'file' };
|
||||
context.subscriptions.push(languages.registerCodeLensProvider(selector, new GitCodeLensProvider(repoPath)));
|
||||
}).catch(reason => console.warn(reason));
|
||||
}
|
||||
|
||||
// this method is called when your extension is deactivated
|
||||
export function deactivate() {
|
||||
}
|
||||
Reference in New Issue
Block a user