Make issue/PR references clickable in @githubpr chat output
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()insrc/common/uri.ts- Converts patterns like
#123,issue 123,issue #123,PR 123,PR #123to markdown links - Uses word boundaries to avoid false matches (e.g., won't match
not#123) - Case-insensitive matching for keywords
- Converts patterns like
-
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:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
Original prompt
This section details on the original issue you should resolve
<issue_title>Issue link should be clickable in
@githubprchat output</issue_title> <issue_description>I've been chatting with
@githubprabout my PR and what it knows.It'd be great for the issue number
7280at the end to be clickable:
</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.