@@ -17,7 +17,7 @@ var findParentDir = require('find-parent-dir');
1717
1818const gitProvider = require ( './gitProvider' ) ;
1919
20- function getGitHubLink ( cb , fileFsPath , line ) {
20+ function getGitProviderLink ( cb , fileFsPath , line ) {
2121 var cwd = workspace . rootPath ;
2222 var repoDir = findParentDir . sync ( workspace . rootPath , '.git' ) || cwd ;
2323
@@ -49,46 +49,47 @@ function getGitHubLink(cb, fileFsPath, line) {
4949 } ) ;
5050}
5151
52- function getGitHubLinkForFile ( fileFsPath , cb ) {
53- getGitHubLink ( cb , fileFsPath ) ;
52+ function getGitProviderLinkForFile ( fileFsPath , cb ) {
53+ getGitProviderLink ( cb , fileFsPath ) ;
5454}
5555
56- function getGitHubLinkForCurrentEditorLine ( cb ) {
56+ function getGitProviderLinkForCurrentEditorLine ( cb ) {
5757 var editor = Window . activeTextEditor ;
5858 if ( editor ) {
5959 var lineIndex = editor . selection . active . line + 1 ;
6060 var fileFsPath = editor . document . uri . fsPath ;
61- getGitHubLink ( cb , fileFsPath , lineIndex ) ;
61+ getGitProviderLink ( cb , fileFsPath , lineIndex ) ;
6262 }
6363}
6464
65- function getGitHubLinkForRepo ( cb ) {
66- getGitHubLink ( cb ) ;
65+ function getGitProviderLinkForRepo ( cb ) {
66+ getGitProviderLink ( cb ) ;
6767}
6868
6969function branchOnCallingContext ( args , cb ) {
7070 if ( args && args . fsPath ) {
71- getGitHubLinkForFile ( args . fsPath , cb ) ;
71+ getGitProviderLinkForFile ( args . fsPath , cb ) ;
7272 }
7373 else if ( Window . activeTextEditor ) {
74- getGitHubLinkForCurrentEditorLine ( cb ) ;
74+ getGitProviderLinkForCurrentEditorLine ( cb ) ;
7575 }
7676 else {
77- getGitHubLinkForRepo ( cb ) ;
77+ getGitProviderLinkForRepo ( cb ) ;
7878 }
7979}
8080
81- function openInGitHub ( args ) {
81+ function openInGitProvider ( args ) {
8282 branchOnCallingContext ( args , open ) ;
8383}
8484
85- function copyGitHubLinkToClipboard ( args ) {
85+ function copyGitProviderLinkToClipboard ( args ) {
8686 branchOnCallingContext ( args , copy ) ;
8787}
8888
89+ //TODO: rename openInGitHub to openInGitProvider
8990function activate ( context ) {
90- context . subscriptions . push ( commands . registerCommand ( 'extension.openInGitHub' , openInGitHub ) ) ;
91- context . subscriptions . push ( commands . registerCommand ( 'extension.copyGitHubLinkToClipboard' , copyGitHubLinkToClipboard ) ) ;
91+ context . subscriptions . push ( commands . registerCommand ( 'extension.openInGitHub' , openInGitProvider ) ) ;
92+ context . subscriptions . push ( commands . registerCommand ( 'extension.copyGitHubLinkToClipboard' , copyGitProviderLinkToClipboard ) ) ;
9293}
9394
9495exports . activate = activate ;
0 commit comments