Skip to content

Make sure we use isEqual to compare uris in chat#301626

Merged
mjbvz merged 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/big-starfish
Mar 13, 2026
Merged

Make sure we use isEqual to compare uris in chat#301626
mjbvz merged 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/big-starfish

Conversation

@mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Mar 13, 2026

Trying to track down cases where we lose the todos or edits. These don't seem like the exact cause but are worth fixing too

Trying to track down cases where we lose the todos or edits. These don't seem like the exact cause but are worth fixing too
Copilot AI review requested due to automatic review settings March 13, 2026 23:14
@mjbvz mjbvz enabled auto-merge March 13, 2026 23:14
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.ts
  • src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.ts
  • src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.ts

@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 13, 2026
Copy link
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 standardizes URI comparisons across the chat/editing codepaths by replacing uri.toString() equality checks with isEqual(...), which is the canonical resource comparison helper in base/common/resources. This helps avoid subtle mismatches that can lead to missed lookups (e.g., tracking modified/active resources) and aligns comparisons with VS Code’s URI comparison utilities.

Changes:

  • Replace toString()-based URI equality checks with isEqual(...) in chat editing, chat session storage migration, markdown rendering, and tools.
  • Add/extend isEqual imports where needed.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.ts Uses isEqual to match the edited entry by modifiedURI reliably.
src/vs/workbench/contrib/chat/common/model/chatSessionStore.ts Uses isEqual when deciding whether storage roots are identical during migration.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.ts Uses isEqual to detect codemapper URI changes when updating collapsed code blocks.
src/vs/workbench/contrib/chat/browser/tools/usagesTool.ts Uses isEqual when checking whether two LocationLinks are in the same file before range overlap checks.
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.ts Uses isEqual to detect whether a resource is currently being modified / modified for decorations.
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.ts Uses isEqual in snapshot equality checks for modified document entries.
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.ts Uses isEqual in snapshot equality checks for deleted file entries.
src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.ts Uses isEqual when finding the editor for the active model to focus after applying edits.

You can also share your feedback on Copilot code review. Take the survey.

@mjbvz mjbvz merged commit 51f27db into microsoft:main Mar 13, 2026
22 checks passed
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.

3 participants