Skip to content

Fix VS Code Copilot Chat deep links#1198

Merged
f merged 1 commit into
mainfrom
fix-vscode-deeplinks
Jun 2, 2026
Merged

Fix VS Code Copilot Chat deep links#1198
f merged 1 commit into
mainfrom
fix-vscode-deeplinks

Conversation

@f

@f f commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Description

The Run button listed VS Code and VS Code Insiders, but those entries only opened the editor and required users to paste the prompt manually. This updates both entries to use the GitHub Copilot Chat URI handler so prompts open prefilled in VS Code or VS Code Insiders.

The same deep-link behavior is wired through the web Run button, the packaged CLI platform builder, and the Raycast extension utility. A small regression test covers the generated VS Code URLs and prompt encoding.

Type of Change

  • Bug fix
  • Documentation update
  • Other (please describe):

⚠️ Want to Add a New Prompt?

Please don't edit prompts.csv directly!

Instead, visit prompts.chat and:

  1. Login with GitHub - Click the login button and authenticate with your GitHub account
  2. Create your prompt - Use the prompt editor to add your new prompt
  3. Submit - Your prompt will be reviewed and a GitHub Action will automatically create a commit on your behalf

This ensures proper attribution, formatting, and keeps the repository in sync. You'll also appear on the Contributors page!


Additional Notes

Validation run:

  • npm run lint -- --quiet
  • npm --prefix packages/prompts.chat run typecheck
  • cd packages/prompts.chat && npx vitest run --config /dev/null src/__tests__/platforms.test.ts

Fix VS Code Copilot Chat Deep Links

Overview

This PR fixes VS Code and VS Code Insiders deep links to use the GitHub Copilot Chat URI handler, enabling prompts to open prefilled directly in the editors rather than requiring manual pasting. The fix is applied consistently across the web UI, CLI, and Raycast extension.

Changes Made

Platform Configuration Updates

  • VS Code base URL: Updated from vscode:// to vscode://GitHub.Copilot-Chat/chat with isDeeplink: true
  • VS Code Insiders base URL: Updated from vscode-insiders:// to vscode-insiders://GitHub.Copilot-Chat/chat with isDeeplink: true
  • Both platforms now support query string parameters for passing prompts

URL Generation

Extended the buildUrl() function in all affected modules to handle VS Code platforms by generating URLs in the format ${baseUrl}?prompt=${encoded}, properly encoding special characters in prompt text.

Affected Components

  1. Web Run Button (src/components/prompts/run-prompt-button.tsx)
  2. CLI Platform Builder (packages/prompts.chat/src/cli/platforms.ts)
  3. Raycast Extension (packages/raycast-extension/src/utils.ts)

Test Coverage

  • New regression test (packages/prompts.chat/src/__tests__/platforms.test.ts): Verifies VS Code and VS Code Insiders platform configurations, validates baseUrl values, and tests that buildUrl() correctly generates URL-encoded prompt query strings with proper handling of special characters (e.g., ampersands, forward slashes)

Validation

All validation checks passed:

  • Linting checks
  • TypeScript type checking
  • Vitest regression test suite

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 2, 2026 23:39
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9a08a6ff-5090-4fee-98c3-52fd828acba2

📥 Commits

Reviewing files that changed from the base of the PR and between b2bae3c and 6c701fe.

📒 Files selected for processing (4)
  • packages/prompts.chat/src/__tests__/platforms.test.ts
  • packages/prompts.chat/src/cli/platforms.ts
  • packages/raycast-extension/src/utils.ts
  • src/components/prompts/run-prompt-button.tsx

📝 Walkthrough

Walkthrough

Updates platform definitions and URL builders across CLI, Raycast extension, and React component to support VS Code and VS Code Insiders deeplinks to Copilot Chat. Each entry point now generates URLs with encoded prompt query parameters for these platforms, validated by a new test suite.

Changes

Copilot Chat deeplink support

Layer / File(s) Summary
VS Code Copilot Chat deeplink definitions
packages/prompts.chat/src/cli/platforms.ts, packages/raycast-extension/src/utils.ts, src/components/prompts/run-prompt-button.tsx
codePlatforms entries for vscode and vscode-insiders updated to use Copilot Chat-specific base URLs (vscode://GitHub.Copilot-Chat/chat and vscode-insiders://GitHub.Copilot-Chat/chat); query string support enabled where applicable.
URL builder for Copilot Chat deeplinks
packages/prompts.chat/src/cli/platforms.ts, packages/raycast-extension/src/utils.ts, src/components/prompts/run-prompt-button.tsx
buildUrl() extended with explicit switch cases for vscode and vscode-insiders platforms to generate URLs with URL-encoded prompt query parameters.
Platform URL builder test suite
packages/prompts.chat/src/__tests__/platforms.test.ts
New Vitest suite validates that codePlatforms contains expected entries and that buildUrl generates correctly encoded prompt query strings for both simple and special-character prompts.

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@f f merged commit 06da777 into main Jun 2, 2026
5 of 7 checks passed
@f f deleted the fix-vscode-deeplinks branch June 2, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the “Run” integrations so the VS Code / VS Code Insiders options generate Copilot Chat deep links with the prompt prefilled (instead of just launching the editor), and adds a small regression test for the generated URLs in the packaged CLI library.

Changes:

  • Update VS Code and VS Code Insiders platform base URLs to target Copilot Chat deep links (web UI, CLI platform builder, Raycast extension).
  • Extend the URL builders to append the encoded prompt for VS Code deep links.
  • Add a Vitest regression test to validate VS Code URL generation and encoding.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/components/prompts/run-prompt-button.tsx Updates VS Code/Insiders “Run” targets and deep-link URL building in the web UI.
packages/raycast-extension/src/utils.ts Updates Raycast platform definitions and URL building for VS Code/Insiders deep links.
packages/prompts.chat/src/cli/platforms.ts Updates the packaged CLI platform list and URL builder for VS Code/Insiders deep links.
packages/prompts.chat/src/tests/platforms.test.ts Adds regression coverage for VS Code deep-link URL generation/encoding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +82 to +83
{ 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 },
name: "VS Code",
baseUrl: "vscode://",
supportsQuerystring: false,
baseUrl: "vscode://GitHub.Copilot-Chat/chat",
name: "VS Code Insiders",
baseUrl: "vscode-insiders://",
supportsQuerystring: false,
baseUrl: "vscode-insiders://GitHub.Copilot-Chat/chat",
Comment on lines +28 to +29
{ 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 },
Comment on lines +11 to +19
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',
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants