vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Make issue/PR references clickable in @githubpr chat output

Open Copilot opened this issue 2 months ago • 0 comments

Issue and PR numbers in @githubpr chat responses appear as plain text (e.g., "This PR addresses issue #7280"), preventing users from quickly navigating to referenced issues.

Changes

  • Added convertIssuePRReferencesToLinks() in src/common/uri.ts

    • Converts patterns like #123, issue 123, issue #123, PR 123, PR #123 to markdown links
    • Uses word boundaries to avoid false matches (e.g., won't match not#123)
    • Case-insensitive matching for keywords
  • Integrated link conversion in chat output processing

    • chatSessionContentBuilder.ts: Applied to historical chat content when loading sessions
    • copilotRemoteAgent.ts: Applied to streaming responses during active sessions
  • Added comprehensive unit tests covering various reference patterns and edge cases

Example

Input text:

This PR addresses issue #7280. See also PR 100 and issue 200.

Output markdown:

This PR addresses issue [#7280](https://github.com/owner/repo/issues/7280). 
See also [PR 100](https://github.com/owner/repo/issues/100) and 
[issue 200](https://github.com/owner/repo/issues/200).

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/node/20.19.6/x64/bin/node node ./out/src/test/runTests.js --grep convertIssuePRReferencesToLinks (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Issue link should be clickable in @githubpr chat output</issue_title> <issue_description>

I've been chatting with @githubpr about my PR and what it knows.

It'd be great for the issue number 7280 at the end to be clickable:

Image</issue_description>

Comments on the Issue (you are @copilot in this section)

@alexr00 We should scan the output for things that look like an issue or PR number and convert them to issue and PR urls using the functions in uri.ts.
  • Fixes microsoft/vscode-pull-request-github#7333

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Dec 11 '25 09:12 Copilot