Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename to "open in browser" #2

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
out
.vscode-test/*
open-in-web-scm-*.vsix
open-in-browser-*.vsix
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

All notable changes to the "open-in-web-scm" extension will be documented in this file.
All notable changes to the "open-in-browser" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# open-in-web-scm
# open-in-browser

Open the current file the source control platform's web UI. This is useful for sharing perma-links with collaborators.

![example](https://raw.githubusercontent.com/andrei-m/vscode-open-in-browser/rename/docs/example.gif)

See [Installation Instructions](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#packaging-extensions).

## Features
Expand Down
Binary file added docs/example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "open-in-web-scm",
"displayName": "Open in Web SCM",
"description": "Create an SCM perma-link from the currently edited file.",
"name": "open-in-browser",
"displayName": "Open in Browser",
"description": "Create a web permalink from the currently edited file.",
"repository": {
"type": "git",
"url": "git@github.com:andrei-m/vscode-open-in-web-scm.git"
"url": "git@github.com:andrei-m/vscode-open-in-browser.git"
},
"version": "0.0.1",
"engines": {
Expand All @@ -18,8 +18,8 @@
"contributes": {
"commands": [
{
"command": "open-in-web-scm.openInWeb",
"title": "Open in Web SCM"
"command": "open-in-browser.open",
"title": "Open in Browser"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as git from './git';
import { open } from './open';

export function activate(context: vscode.ExtensionContext) {
const disposable = vscode.commands.registerCommand('open-in-web-scm.openInWeb', () => {
const disposable = vscode.commands.registerCommand('open-in-browser.open', () => {
const editorInfo = editor.getEditorInfo();
if (editorInfo) {
git.getGitInfo().then(simpleGitInfo => {
Expand Down
16 changes: 8 additions & 8 deletions src/test/open.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ import { Selection } from '../editor';

suite('gitUrlToWebUrl', () => {
test('Github single line', () => {
const url = new UrlParsed('github.com', '/andrei-m/vscode-open-in-web-scm.git');
const url = new UrlParsed('github.com', '/andrei-m/vscode-open-in-browser.git');
const selection = new Selection('src/open.ts', 1, 1);
const webUrl = gitUrlToWebUrl(url, UrlPlatform.Github, 'deadbeef', selection);
assert.strictEqual('https://github.com/andrei-m/vscode-open-in-web-scm/blob/deadbeef/src/open.ts#L1', webUrl);
assert.strictEqual('https://github.com/andrei-m/vscode-open-in-browser/blob/deadbeef/src/open.ts#L1', webUrl);
});

test('Github multi line', () => {
const url = new UrlParsed('github.com', '/andrei-m/vscode-open-in-web-scm.git');
const url = new UrlParsed('github.com', '/andrei-m/vscode-open-in-browser.git');
const selection = new Selection('src/open.ts', 3, 5);
const webUrl = gitUrlToWebUrl(url, UrlPlatform.Github, 'deadbeef', selection);
assert.strictEqual('https://github.com/andrei-m/vscode-open-in-web-scm/blob/deadbeef/src/open.ts#L3-L5', webUrl);
assert.strictEqual('https://github.com/andrei-m/vscode-open-in-browser/blob/deadbeef/src/open.ts#L3-L5', webUrl);
});

test('Gitlab single line', () => {
const url = new UrlParsed('gitlab.com', '/andrei-m/vscode-open-in-web-scm.git');
const url = new UrlParsed('gitlab.com', '/andrei-m/vscode-open-in-browser.git');
const selection = new Selection('src/open.ts', 1, 1);
const webUrl = gitUrlToWebUrl(url, UrlPlatform.Stash, 'deadbeef', selection);
assert.strictEqual('https://gitlab.com/andrei-m/vscode-open-in-web-scm/-/blob/deadbeef/src/open.ts#L1', webUrl);
assert.strictEqual('https://gitlab.com/andrei-m/vscode-open-in-browser/-/blob/deadbeef/src/open.ts#L1', webUrl);
});

test('Gitlab multi line', () => {
const url = new UrlParsed('gitlab.com', '/andrei-m/vscode-open-in-web-scm.git');
const url = new UrlParsed('gitlab.com', '/andrei-m/vscode-open-in-browser.git');
const selection = new Selection('src/open.ts', 3, 5);
const webUrl = gitUrlToWebUrl(url, UrlPlatform.Gitlab, 'deadbeef', selection);
assert.strictEqual('https://gitlab.com/andrei-m/vscode-open-in-web-scm/-/blob/deadbeef/src/open.ts#L3-L5', webUrl);
assert.strictEqual('https://gitlab.com/andrei-m/vscode-open-in-browser/-/blob/deadbeef/src/open.ts#L3-L5', webUrl);
});

test('Stash single line', () => {
Expand Down