Make sure we use isEqual to compare uris in chat#301626
Merged
mjbvz merged 1 commit intomicrosoft:mainfrom Mar 13, 2026
Merged
Conversation
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
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @jriekenMatched files:
|
Contributor
There was a problem hiding this comment.
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 withisEqual(...)in chat editing, chat session storage migration, markdown rendering, and tools. - Add/extend
isEqualimports 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.
roblourens
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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