Skip to content

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Sep 11, 2025

Fixes #5692
Fixes #5694

@DanTup DanTup added this to the v3.120.0 milestone Sep 11, 2025
@DanTup DanTup added is enhancement is bug fix in editor Relates to code editing or language features labels Sep 11, 2025
@DanTup DanTup requested a review from Copilot September 11, 2025 12:10
@DanTup
Copy link
Member Author

DanTup commented Sep 11, 2025

/gemini review
@codex review

Copy link

Copilot AI left a comment

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 improves handling of package: URIs in the Dart extension's terminal link provider and document links by addressing scenarios where multiple packages might match the same URI. The changes enhance the user experience by providing options when multiple matches exist and prioritizing project-specific package maps for document links.

  • Enhanced terminal link handling to support multiple package URI matches with peek functionality
  • Improved document link resolution to prioritize current project's package map
  • Added TODO comments for future test coverage improvements

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/extension/terminal/package_uri_link_provider.ts Enhanced package URI resolution to handle multiple matches and improved document link provider logic
src/test/dart/providers/terminal_link_providers.test.ts Added TODO comments outlining needed test coverage for multiple package URI scenarios

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the handling of package: URIs by resolving them to all possible file locations when multiple projects in the workspace have the same dependency. When a terminal link has multiple targets, it now shows a peek definition view to allow the user to choose. For document links, it prioritizes the package map of the current project. The changes are well-implemented. I've left a couple of minor suggestions to remove some debug code and improve code clarity.

Comment on lines 85 to 86
const link = locations[0];
void vs.commands.executeCommand("_dart.jumpToLineColInUri", link.uri, link.range.start.line, link.range.start.character);

Choose a reason for hiding this comment

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

medium

The constant link here shadows the function parameter with the same name. To avoid confusion and improve readability, consider renaming it to something like location.

const location = locations[0];
			void vs.commands.executeCommand("_dart.jumpToLineColInUri", location.uri, location.range.start.line, location.range.start.character);

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@DanTup DanTup merged commit 60199a5 into master Sep 11, 2025
17 checks passed
@DanTup DanTup deleted the multiple-terminal-links branch September 11, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in editor Relates to code editing or language features is bug fix is enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document Links may link to the wrong version of a package Ask which file to open if package: uri has multiple matches from a terminal Ctrl+Click

2 participants