( type: string, filePath: string, insiders = false )
| 179 | * @param insiders - Whether to use VS Code Insiders |
| 180 | */ |
| 181 | export 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 |
no outgoing calls
no test coverage detected