Skip to content

fix - file and directory link navigation in chat tool results#272

Merged
jdneo merged 3 commits into
mainfrom
tori/fix-file-link
Jun 2, 2026
Merged

fix - file and directory link navigation in chat tool results#272
jdneo merged 3 commits into
mainfrom
tori/fix-file-link

Conversation

@xinyi-gong
Copy link
Copy Markdown
Member

Fixes #262

Problem

Clicking file path links in Chat tool results fails to open files that are outside the Eclipse workspace. Directory links in the workspace also had no meaningful behavior.

Changes

  • When a file link does not resolve to a workspace resource, fall back to opening it as a local filesystem file in an editor.
  • Handle workspace directory and project links by revealing them in the Project Explorer instead of opening the browser.
  • Centralized local path resolution logic into the core bundle, removing duplication from the file tools.

Copilot AI review requested due to automatic review settings June 1, 2026 09:01
Copy link
Copy Markdown
Contributor

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 fixes chat tool result link navigation by improving how file and directory hyperlinks are resolved and opened in the Eclipse UI, especially for local filesystem paths outside the workspace.

Changes:

  • Centralizes local filesystem path/file: URI parsing in core via FileUtils.getLocalFilePath(...) and updates file tools to use it.
  • Updates chat hyperlink opening to:
    • open local files outside the workspace in an editor, and
    • reveal workspace folders/projects in Project Explorer (instead of delegating to the browser).
  • Extends SWTBot test plan documentation with a new test case covering local file link navigation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/tools/FileToolBase.java Removes duplicated local-path parsing helper (now centralized in core).
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/tools/EditFileTool.java Switches to FileUtils.getLocalFilePath(...) for local edits.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/tools/CreateFileTool.java Switches to FileUtils.getLocalFilePath(...) for local creates.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/FileAnnotationHyperlinkDetector.java Adds folder/project reveal + local-file editor fallback for file: links.
com.microsoft.copilot.eclipse.swtbot.test/test-plans/file-system/local-file-edit-and-create-tools.md Adds a test plan section for navigating to local files from tool links.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/utils/FileUtils.java Adds getLocalFilePath(...) and fragment stripping to support consistent parsing.

@jdneo jdneo merged commit 5b2397d into main Jun 2, 2026
4 checks passed
@jdneo jdneo deleted the tori/fix-file-link branch June 2, 2026 05:36
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.

[Bug] Cannot navigate to the file out of workspace

4 participants