Skip to content

Commit bbf2b93

Browse files
author
Eric Amodio
committed
Removes Open repository command for now
Until we stabilize the uris want to limit the visibility of this
1 parent d0bd822 commit bbf2b93

2 files changed

Lines changed: 26 additions & 31 deletions

File tree

extensions/github-browser/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
"main": "./out/extension.js",
2222
"contributes": {
2323
"commands": [
24-
{
25-
"command": "githubBrowser.openRepository",
26-
"title": "Open GitHub Repository...",
27-
"category": "GitHub Browser"
28-
},
2924
{
3025
"command": "githubBrowser.commit",
3126
"title": "Commit",
@@ -55,7 +50,7 @@
5550
"commandPalette": [
5651
{
5752
"command": "githubBrowser.commit",
58-
"when": "github.hasChanges"
53+
"when": "false"
5954
},
6055
{
6156
"command": "githubBrowser.discardChanges",

extensions/github-browser/src/extension.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { GitHubApiContext, GitHubApi } from './github/api';
1010
import { GitHubFS } from './github/fs';
1111
import { VirtualSCM } from './scm';
1212

13-
const repositoryRegex = /^(?:(?:https:\/\/)?github.com\/)?([^\/]+)\/([^\/]+?)(?:\/|.git|$)/i;
13+
// const repositoryRegex = /^(?:(?:https:\/\/)?github.com\/)?([^\/]+)\/([^\/]+?)(?:\/|.git|$)/i;
1414

1515
export function activate(context: ExtensionContext) {
1616
const contextStore = new ContextStore<GitHubApiContext>(context.workspaceState, GitHubFS.scheme);
@@ -27,34 +27,34 @@ export function activate(context: ExtensionContext) {
2727
new VirtualSCM(GitHubFS.scheme, githubApi, changeStore)
2828
);
2929

30-
commands.registerCommand('githubBrowser.openRepository', async () => {
31-
const value = await window.showInputBox({
32-
placeHolder: 'e.g. https://github.com/microsoft/vscode',
33-
prompt: 'Enter a GitHub repository url',
34-
validateInput: value => repositoryRegex.test(value) ? undefined : 'Invalid repository url'
35-
});
36-
37-
if (value) {
38-
const match = repositoryRegex.exec(value);
39-
if (match) {
40-
const [, owner, repo] = match;
41-
42-
const uri = Uri.parse(`codespace://HEAD/${owner}/${repo}`);
43-
openWorkspace(uri, repo, 'currentWindow');
44-
}
45-
}
46-
});
30+
// commands.registerCommand('githubBrowser.openRepository', async () => {
31+
// const value = await window.showInputBox({
32+
// placeHolder: 'e.g. https://github.com/microsoft/vscode',
33+
// prompt: 'Enter a GitHub repository url',
34+
// validateInput: value => repositoryRegex.test(value) ? undefined : 'Invalid repository url'
35+
// });
36+
37+
// if (value) {
38+
// const match = repositoryRegex.exec(value);
39+
// if (match) {
40+
// const [, owner, repo] = match;
41+
42+
// const uri = Uri.parse(`codespace://HEAD/${owner}/${repo}`);
43+
// openWorkspace(uri, repo, 'currentWindow');
44+
// }
45+
// }
46+
// });
4747
}
4848

4949
export function getRootUri(uri: Uri) {
5050
return workspace.getWorkspaceFolder(uri)?.uri;
5151
}
5252

53-
function openWorkspace(uri: Uri, name: string, location: 'currentWindow' | 'newWindow' | 'addToCurrentWorkspace') {
54-
if (location === 'addToCurrentWorkspace') {
55-
const count = (workspace.workspaceFolders && workspace.workspaceFolders.length) || 0;
56-
return workspace.updateWorkspaceFolders(count, 0, { uri: uri, name: name });
57-
}
53+
// function openWorkspace(uri: Uri, name: string, location: 'currentWindow' | 'newWindow' | 'addToCurrentWorkspace') {
54+
// if (location === 'addToCurrentWorkspace') {
55+
// const count = (workspace.workspaceFolders && workspace.workspaceFolders.length) || 0;
56+
// return workspace.updateWorkspaceFolders(count, 0, { uri: uri, name: name });
57+
// }
5858

59-
return commands.executeCommand('vscode.openFolder', uri, location === 'newWindow');
60-
}
59+
// return commands.executeCommand('vscode.openFolder', uri, location === 'newWindow');
60+
// }

0 commit comments

Comments
 (0)