diff --git a/.vscode/settings.json b/.vscode/settings.json index a8089c7..0b91745 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,4 +6,6 @@ "search.exclude": { "out": true } +, +"typescript.check.workspaceVersion": false } \ No newline at end of file diff --git a/package.json b/package.json index c1c922c..809a86a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Open in GitHub / Bitbucket / VisualStudio.com !", "description": "Jump to a source code line in Github / Bitbucket / VisualStudio.com !", "icon": "images/icon_200.png", - "version": "1.2.1", + "version": "1.2.3", "publisher": "ziyasal", "license": "SEE LICENSE IN LICENSE.md", "galleryBanner": { diff --git a/src/extension.js b/src/extension.js index 7ea3c4b..4e0d6c5 100644 --- a/src/extension.js +++ b/src/extension.js @@ -17,7 +17,7 @@ var findParentDir = require('find-parent-dir'); const gitProvider = require('./gitProvider'); -function getGitHubLink(cb, fileFsPath, line) { +function getGitProviderLink(cb, fileFsPath, line) { var cwd = workspace.rootPath; var repoDir = findParentDir.sync(workspace.rootPath, '.git') || cwd; @@ -49,46 +49,47 @@ function getGitHubLink(cb, fileFsPath, line) { }); } -function getGitHubLinkForFile(fileFsPath, cb) { - getGitHubLink(cb, fileFsPath); +function getGitProviderLinkForFile(fileFsPath, cb) { + getGitProviderLink(cb, fileFsPath); } -function getGitHubLinkForCurrentEditorLine(cb) { +function getGitProviderLinkForCurrentEditorLine(cb) { var editor = Window.activeTextEditor; if (editor) { var lineIndex = editor.selection.active.line + 1; var fileFsPath = editor.document.uri.fsPath; - getGitHubLink(cb, fileFsPath, lineIndex); + getGitProviderLink(cb, fileFsPath, lineIndex); } } -function getGitHubLinkForRepo(cb) { - getGitHubLink(cb); +function getGitProviderLinkForRepo(cb) { + getGitProviderLink(cb); } function branchOnCallingContext(args, cb) { if (args && args.fsPath) { - getGitHubLinkForFile(args.fsPath, cb); + getGitProviderLinkForFile(args.fsPath, cb); } else if (Window.activeTextEditor) { - getGitHubLinkForCurrentEditorLine(cb); + getGitProviderLinkForCurrentEditorLine(cb); } else { - getGitHubLinkForRepo(cb); + getGitProviderLinkForRepo(cb); } } -function openInGitHub(args) { +function openInGitProvider(args) { branchOnCallingContext(args, open); } -function copyGitHubLinkToClipboard(args) { +function copyGitProviderLinkToClipboard(args) { branchOnCallingContext(args, copy); } +//TODO: rename openInGitHub to openInGitProvider function activate(context) { - context.subscriptions.push(commands.registerCommand('extension.openInGitHub', openInGitHub)); - context.subscriptions.push(commands.registerCommand('extension.copyGitHubLinkToClipboard', copyGitHubLinkToClipboard)); + context.subscriptions.push(commands.registerCommand('extension.openInGitHub', openInGitProvider)); + context.subscriptions.push(commands.registerCommand('extension.copyGitHubLinkToClipboard', copyGitProviderLinkToClipboard)); } exports.activate = activate;