From 06da77737aecab8a8abaaf80d459b7a0fa36c867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20Kadir=20Ak=C4=B1n?= Date: Wed, 3 Jun 2026 02:41:17 +0300 Subject: [PATCH] fix: add VS Code Copilot Chat deep links (#1198) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/__tests__/platforms.test.ts | 21 +++++++++++++++++++ packages/prompts.chat/src/cli/platforms.ts | 7 +++++-- packages/raycast-extension/src/utils.ts | 11 ++++++---- src/components/prompts/run-prompt-button.tsx | 7 +++++-- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 packages/prompts.chat/src/__tests__/platforms.test.ts diff --git a/packages/prompts.chat/src/__tests__/platforms.test.ts b/packages/prompts.chat/src/__tests__/platforms.test.ts new file mode 100644 index 00000000..b13f93b9 --- /dev/null +++ b/packages/prompts.chat/src/__tests__/platforms.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from 'vitest'; +import { buildUrl, codePlatforms } from '../cli/platforms'; + +describe('platform URL builder', () => { + it('builds VS Code Copilot Chat deep links with encoded prompts', () => { + const vscode = codePlatforms.find((platform) => platform.id === 'vscode'); + const insiders = codePlatforms.find((platform) => platform.id === 'vscode-insiders'); + + expect(vscode).toBeDefined(); + expect(insiders).toBeDefined(); + expect(vscode?.baseUrl).toBe('vscode://GitHub.Copilot-Chat/chat'); + expect(insiders?.baseUrl).toBe('vscode-insiders://GitHub.Copilot-Chat/chat'); + + expect(buildUrl('vscode', vscode!.baseUrl, 'Review this code & explain it')).toBe( + 'vscode://GitHub.Copilot-Chat/chat?prompt=Review%20this%20code%20%26%20explain%20it', + ); + expect(buildUrl('vscode-insiders', insiders!.baseUrl, '/fix failing tests')).toBe( + 'vscode-insiders://GitHub.Copilot-Chat/chat?prompt=%2Ffix%20failing%20tests', + ); + }); +}); diff --git a/packages/prompts.chat/src/cli/platforms.ts b/packages/prompts.chat/src/cli/platforms.ts index 3140ab5f..38c776b4 100644 --- a/packages/prompts.chat/src/cli/platforms.ts +++ b/packages/prompts.chat/src/cli/platforms.ts @@ -25,8 +25,8 @@ export const videoPlatforms: Platform[] = [ export const codePlatforms: Platform[] = [ { id: "windsurf", name: "Windsurf", baseUrl: "windsurf://", isDeeplink: true, supportsQuerystring: false, sponsor: true }, - { id: "vscode", name: "VS Code", baseUrl: "vscode://", isDeeplink: true, supportsQuerystring: false }, - { id: "vscode-insiders", name: "VS Code Insiders", baseUrl: "vscode-insiders://", isDeeplink: true, supportsQuerystring: false }, + { id: "vscode", name: "VS Code", baseUrl: "vscode://GitHub.Copilot-Chat/chat", isDeeplink: true }, + { id: "vscode-insiders", name: "VS Code Insiders", baseUrl: "vscode-insiders://GitHub.Copilot-Chat/chat", isDeeplink: true }, { id: "cursor", name: "Cursor", baseUrl: "cursor://anysphere.cursor-deeplink/prompt", isDeeplink: true }, { id: "goose", name: "Goose", baseUrl: "goose://recipe", isDeeplink: true }, { id: "github-copilot", name: "GitHub Copilot Chat", baseUrl: "https://github.com/copilot" }, @@ -71,6 +71,9 @@ export function buildUrl( switch (platformId) { case "cursor": return `${baseUrl}?text=${encoded}`; + case "vscode": + case "vscode-insiders": + return `${baseUrl}?prompt=${encoded}`; case "goose": { const config = JSON.stringify({ version: "1.0.0", diff --git a/packages/raycast-extension/src/utils.ts b/packages/raycast-extension/src/utils.ts index 1d8f3b36..a0d9ddf7 100644 --- a/packages/raycast-extension/src/utils.ts +++ b/packages/raycast-extension/src/utils.ts @@ -175,15 +175,15 @@ export const codePlatforms: Platform[] = [ { id: "vscode", name: "VS Code", - baseUrl: "vscode://", - supportsQuerystring: false, + baseUrl: "vscode://GitHub.Copilot-Chat/chat", + supportsQuerystring: true, isDeeplink: true, }, { id: "vscode-insiders", name: "VS Code Insiders", - baseUrl: "vscode-insiders://", - supportsQuerystring: false, + baseUrl: "vscode-insiders://GitHub.Copilot-Chat/chat", + supportsQuerystring: true, isDeeplink: true, }, { @@ -243,6 +243,9 @@ export function buildUrl( // IDE deeplinks case "cursor": return `${baseUrl}?text=${encoded}`; + case "vscode": + case "vscode-insiders": + return `${baseUrl}?prompt=${encoded}`; case "goose": case "goose-chat": { const config = JSON.stringify({ diff --git a/src/components/prompts/run-prompt-button.tsx b/src/components/prompts/run-prompt-button.tsx index e5293c45..72dcbf30 100644 --- a/src/components/prompts/run-prompt-button.tsx +++ b/src/components/prompts/run-prompt-button.tsx @@ -79,8 +79,8 @@ const videoPlatforms: Platform[] = [ const codePlatforms: Platform[] = [ { id: "commandcode", name: "Command Code", baseUrl: "https://commandcode.ai/?utm_source=prompts.chat", supportsQuerystring: false, sponsor: true }, { id: "windsurf", name: "Windsurf", baseUrl: "windsurf://", isDeeplink: true, supportsQuerystring: false, sponsor: true }, - { id: "vscode", name: "VS Code", baseUrl: "vscode://", isDeeplink: true, supportsQuerystring: false }, - { id: "vscode-insiders", name: "VS Code Insiders", baseUrl: "vscode-insiders://", isDeeplink: true, supportsQuerystring: false }, + { id: "vscode", name: "VS Code", baseUrl: "vscode://GitHub.Copilot-Chat/chat", isDeeplink: true }, + { id: "vscode-insiders", name: "VS Code Insiders", baseUrl: "vscode-insiders://GitHub.Copilot-Chat/chat", isDeeplink: true }, { id: "cursor", name: "Cursor", baseUrl: "cursor://anysphere.cursor-deeplink/prompt", isDeeplink: true }, { id: "goose", name: "Goose", baseUrl: "goose://recipe", isDeeplink: true }, { @@ -136,6 +136,9 @@ function buildUrl(platformId: string, baseUrl: string, promptText: string, promp // IDE deeplinks case "cursor": return `${baseUrl}?text=${encoded}`; + case "vscode": + case "vscode-insiders": + return `${baseUrl}?prompt=${encoded}`; case "goose": { const config = JSON.stringify({ version: "1.0.0",