disable-vscodedev.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. diff --git a/extensions/github/package.json b/extensions/github/package.json
  2. index 726a882..b9a4969 100644
  3. --- a/extensions/github/package.json
  4. +++ b/extensions/github/package.json
  5. @@ -44,19 +44,2 @@
  6. },
  7. - {
  8. - "command": "github.copyVscodeDevLink",
  9. - "title": "%command.copyVscodeDevLink%"
  10. - },
  11. - {
  12. - "command": "github.copyVscodeDevLinkFile",
  13. - "title": "%command.copyVscodeDevLink%"
  14. - },
  15. - {
  16. - "command": "github.copyVscodeDevLinkWithoutRange",
  17. - "title": "%command.copyVscodeDevLink%"
  18. - },
  19. - {
  20. - "command": "github.openOnVscodeDev",
  21. - "title": "%command.openOnVscodeDev%",
  22. - "icon": "$(globe)"
  23. - },
  24. {
  25. @@ -72,11 +55,2 @@
  26. ],
  27. - "continueEditSession": [
  28. - {
  29. - "command": "github.openOnVscodeDev",
  30. - "when": "github.hasGitHubRepo",
  31. - "qualifiedName": "Continue Working in vscode.dev",
  32. - "category": "Remote Repositories",
  33. - "remoteGroup": "virtualfs_44_vscode-vfs_2_web@2"
  34. - }
  35. - ],
  36. "menus": {
  37. @@ -91,18 +65,2 @@
  38. },
  39. - {
  40. - "command": "github.copyVscodeDevLink",
  41. - "when": "false"
  42. - },
  43. - {
  44. - "command": "github.copyVscodeDevLinkFile",
  45. - "when": "false"
  46. - },
  47. - {
  48. - "command": "github.copyVscodeDevLinkWithoutRange",
  49. - "when": "false"
  50. - },
  51. - {
  52. - "command": "github.openOnVscodeDev",
  53. - "when": "false"
  54. - },
  55. {
  56. @@ -112,42 +70,2 @@
  57. ],
  58. - "file/share": [
  59. - {
  60. - "command": "github.copyVscodeDevLinkFile",
  61. - "when": "github.hasGitHubRepo && remoteName != 'codespaces'",
  62. - "group": "0_vscode@0"
  63. - }
  64. - ],
  65. - "editor/context/share": [
  66. - {
  67. - "command": "github.copyVscodeDevLink",
  68. - "when": "github.hasGitHubRepo && resourceScheme != untitled && !isInEmbeddedEditor && remoteName != 'codespaces'",
  69. - "group": "0_vscode@0"
  70. - }
  71. - ],
  72. - "explorer/context/share": [
  73. - {
  74. - "command": "github.copyVscodeDevLinkWithoutRange",
  75. - "when": "github.hasGitHubRepo && resourceScheme != untitled && !isInEmbeddedEditor && remoteName != 'codespaces'",
  76. - "group": "0_vscode@0"
  77. - }
  78. - ],
  79. - "editor/lineNumber/context": [
  80. - {
  81. - "command": "github.copyVscodeDevLink",
  82. - "when": "github.hasGitHubRepo && resourceScheme != untitled && activeEditor == workbench.editors.files.textFileEditor && config.editor.lineNumbers == on && remoteName != 'codespaces'",
  83. - "group": "1_cutcopypaste@2"
  84. - },
  85. - {
  86. - "command": "github.copyVscodeDevLink",
  87. - "when": "github.hasGitHubRepo && resourceScheme != untitled && activeEditor == workbench.editor.notebook && remoteName != 'codespaces'",
  88. - "group": "1_cutcopypaste@2"
  89. - }
  90. - ],
  91. - "editor/title/context/share": [
  92. - {
  93. - "command": "github.copyVscodeDevLinkWithoutRange",
  94. - "when": "github.hasGitHubRepo && resourceScheme != untitled && remoteName != 'codespaces'",
  95. - "group": "0_vscode@0"
  96. - }
  97. - ],
  98. "scm/historyItem/context": [
  99. diff --git a/extensions/github/src/commands.ts b/extensions/github/src/commands.ts
  100. index 48e9574..aa853a5 100644
  101. --- a/extensions/github/src/commands.ts
  102. +++ b/extensions/github/src/commands.ts
  103. @@ -9,28 +9,3 @@ import { publishRepository } from './publish.js';
  104. import { DisposableStore, getRepositoryFromUrl } from './util.js';
  105. -import { LinkContext, getCommitLink, getLink, getVscodeDevHost } from './links.js';
  106. -
  107. -async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean, context: LinkContext, includeRange = true) {
  108. - try {
  109. - const permalink = await getLink(gitAPI, useSelection, true, getVscodeDevHost(), 'headlink', context, includeRange);
  110. - if (permalink) {
  111. - return vscode.env.clipboard.writeText(permalink);
  112. - }
  113. - } catch (err) {
  114. - if (!(err instanceof vscode.CancellationError)) {
  115. - vscode.window.showErrorMessage(err.message);
  116. - }
  117. - }
  118. -}
  119. -
  120. -async function openVscodeDevLink(gitAPI: GitAPI): Promise<vscode.Uri | undefined> {
  121. - try {
  122. - const headlink = await getLink(gitAPI, true, false, getVscodeDevHost(), 'headlink');
  123. - return headlink ? vscode.Uri.parse(headlink) : undefined;
  124. - } catch (err) {
  125. - if (!(err instanceof vscode.CancellationError)) {
  126. - vscode.window.showErrorMessage(err.message);
  127. - }
  128. - return undefined;
  129. - }
  130. -}
  131. +import { getCommitLink } from './links.js';
  132. @@ -70,14 +45,2 @@ export function registerCommands(gitAPI: GitAPI): vscode.Disposable {
  133. - disposables.add(vscode.commands.registerCommand('github.copyVscodeDevLink', async (context: LinkContext) => {
  134. - return copyVscodeDevLink(gitAPI, true, context);
  135. - }));
  136. -
  137. - disposables.add(vscode.commands.registerCommand('github.copyVscodeDevLinkFile', async (context: LinkContext) => {
  138. - return copyVscodeDevLink(gitAPI, false, context);
  139. - }));
  140. -
  141. - disposables.add(vscode.commands.registerCommand('github.copyVscodeDevLinkWithoutRange', async (context: LinkContext) => {
  142. - return copyVscodeDevLink(gitAPI, true, context, false);
  143. - }));
  144. -
  145. disposables.add(vscode.commands.registerCommand('github.openOnGitHub', async (url: string, historyItemId: string) => {
  146. @@ -113,6 +76,2 @@ export function registerCommands(gitAPI: GitAPI): vscode.Disposable {
  147. - disposables.add(vscode.commands.registerCommand('github.openOnVscodeDev', async () => {
  148. - return openVscodeDevLink(gitAPI);
  149. - }));
  150. -
  151. return disposables;
  152. diff --git a/extensions/github/src/extension.ts b/extensions/github/src/extension.ts
  153. index 17906c5..86a0ca8 100644
  154. --- a/extensions/github/src/extension.ts
  155. +++ b/extensions/github/src/extension.ts
  156. @@ -17,3 +17,2 @@ import { GitHubBranchProtectionProviderManager } from './branchProtection.js';
  157. import { GitHubCanonicalUriProvider } from './canonicalUriProvider.js';
  158. -import { VscodeDevShareProvider } from './shareProviders.js';
  159. import { GitHubSourceControlHistoryItemDetailsProvider } from './historyItemDetailsProvider.js';
  160. @@ -109,3 +108,2 @@ function initializeGitExtension(context: ExtensionContext, octokitService: Octok
  161. disposables.add(new GitHubCanonicalUriProvider(gitAPI));
  162. - disposables.add(new VscodeDevShareProvider(gitAPI));
  163. setGitHubContext(gitAPI, disposables);
  164. diff --git a/extensions/github/src/remoteSourceProvider.ts b/extensions/github/src/remoteSourceProvider.ts
  165. index 291a3f1..6304ed8 100644
  166. --- a/extensions/github/src/remoteSourceProvider.ts
  167. +++ b/extensions/github/src/remoteSourceProvider.ts
  168. @@ -10,3 +10,3 @@ import { Octokit } from '@octokit/rest';
  169. import { getRepositoryFromQuery, getRepositoryFromUrl } from './util.js';
  170. -import { getBranchLink, getVscodeDevHost } from './links.js';
  171. +import { getBranchLink } from './links.js';
  172. @@ -129,9 +129,2 @@ export class GithubRemoteSourceProvider implements RemoteSourceProvider {
  173. }
  174. - }, {
  175. - label: l10n.t('Checkout on vscode.dev'),
  176. - icon: 'globe',
  177. - run(branch: string) {
  178. - const link = getBranchLink(url, branch, getVscodeDevHost());
  179. - env.openExternal(Uri.parse(link));
  180. - }
  181. }];