MCPcopy
hub / github.com/github/awesome-copilot / getVSCodeInstallUrl

Function getVSCodeInstallUrl

website/src/scripts/utils.ts:181–196  ·  view source on GitHub ↗
(
  type: string,
  filePath: string,
  insiders = false
)

Source from the content-addressed store, hash-verified

179 * @param insiders - Whether to use VS Code Insiders
180 */
181export function getVSCodeInstallUrl(
182 type: string,
183 filePath: string,
184 insiders = false
185): string | null {
186 const config = VSCODE_INSTALL_CONFIG[type];
187 if (!config) return null;
188
189 const rawUrl = `${REPO_BASE_URL}/${filePath}`;
190 const vscodeScheme = insiders ? "vscode-insiders" : "vscode";
191 const innerUrl = `${vscodeScheme}:${
192 config.scheme
193 }/install?url=${encodeURIComponent(rawUrl)}`;
194
195 return `${config.baseUrl}?url=${encodeURIComponent(innerUrl)}`;
196}
197
198/**
199 * Get GitHub URL for a file

Callers 4

openFileModalFunction · 0.90
openAgentDetailsModalFunction · 0.90
getInstallDropdownHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected