Fix text/uri-list transformation in tree view drag for remote environments#292818
Merged
Fix text/uri-list transformation in tree view drag for remote environments#292818
Conversation
…e environments Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix 'File does not exist' error when dragging files from search
Fix text/uri-list transformation in tree view drag for remote environments
Feb 4, 2026
alexr00
approved these changes
Feb 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in tree view drag-and-drop functionality for remote environments (WSL/Docker containers). When dragging files from tree views (e.g., references search panel), users were encountering "File does not exist" errors. The root cause was that the handleDrag method was using the untransformed URI string (asString) instead of the transformed URIs (uriListData) that had already been processed by the URI transformer during RPC communication.
Changes:
- Fixed
TreeViewDragAndDropController.handleDrag()to prioritizeuriListDataoverasStringfortext/uri-listmime types - Added comprehensive test validating that transformed URIs from
uriListDataare correctly used over untransformed strings
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/vs/workbench/api/browser/mainThreadTreeViews.ts | Fixed handleDrag to reconstruct URI list from uriListData using UriList.create() and URI.revive(), matching the pattern from extHostTypeConverters.ts |
| src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts | Added test case that verifies transformed URIs in uriListData are used instead of untransformed asString values |
hediet
approved these changes
Feb 6, 2026
daviddossett
pushed a commit
to daviddossett/vscode
that referenced
this pull request
Feb 7, 2026
…ments (microsoft#292818) * Initial plan * Fix text/uri-list transformation in tree view drag and drop for remote environments Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Improve variable naming in handleDrag test Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Dragging files from tree views (e.g., references search panel) in remote environments (WSL/Docker) fails with "File does not exist" error. The
handleDragmethod inTreeViewDragAndDropControllerwas usingitem.asStringwhich contains the untransformed URI, ignoringitem.uriListDatawhich contains URIs already processed by the URI transformer during RPC.Changes
mainThreadTreeViews.ts: Fortext/uri-listmime type, reconstruct URI string fromuriListDatausingUriList.create()andURI.revive()instead of rawasStringmainThreadTreeViews.test.ts: Added test verifying transformed URIs are used over untransformed stringsTesting
Original prompt
This section details on the original issue you should resolve
<issue_title>After searching for a reference and dragging the file, a “File does not exist” error occurs.</issue_title>
<issue_description>
Type: Bug
Behaviour
If I search for a reference and then drag the file, I get a “File does not exist” error.
This issue is likely caused by mixed file path separators (‘/’ and ‘\’).
The file opens fine when opened directly.
There are no issues even with simple searches, not just references.
This occurs$$\color{red}not\ only\ in\ Python\ but\ also\ in\ Go,\ C,\ and\ even\ Markdown$$ .
(It works normally in VS Code on the host, not in WSL.)
Steps to reproduce:
Diagnostic data
None
Detail
VS Code version: Code 1.107
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
User Settings
Installed Extensions
System Info
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
Comments on the Issue (you are @copilot in this section)
@jrieken @alexr00 I am using the extension tree API and I wonder if the `TreeDragAndDropController` sends dnd data with type `text...💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.