Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[navigator] don't use ':' as separator in drop event's payload #3650

Open
JanKoehnlein opened this issue Nov 27, 2018 · 2 comments
Open

[navigator] don't use ':' as separator in drop event's payload #3650

JanKoehnlein opened this issue Nov 27, 2018 · 2 comments
Labels
enhancement issues that are enhancements to current functionality - nice to haves tree issues related to the tree (ex: tree widget)

Comments

@JanKoehnlein
Copy link
Contributor

JanKoehnlein commented Nov 27, 2018

When dropping a file from the navigator, the drop target resolves the file by looking at event.dataTransfer.get('tree-node'). This yields a string composed of the workspace folder's path, a colon, and the file's path. Using a colon makes it pretty nasty on windows to parse this, as the colon is also used as a drive letter separator in both paths. We should

  • use a different separator
  • provide a function to parse this

Maybe there is already such function and I just missed it?

@akosyakov akosyakov added enhancement issues that are enhancements to current functionality - nice to haves tree issues related to the tree (ex: tree widget) labels Nov 27, 2018
@akosyakov
Copy link
Member

tree-node returns a node id, not URI

Let's replace tree-node with tree-data. It should consist of a widget id and node id. Clients can check from which widget drop event is coming by a widget id then and use a node id to retrieve a node from this widget.

@westbury
Copy link
Contributor

Something like this: https://github.com/westbury/theia/tree/GH-3650 ?

The benefits can't be seen in the example Theia build as there is only one file system tree (other than in the file dialogs). However for those of us who have extensions with file system trees, dnd now works between them. Thanks for the suggestion. The regex to parse the id is not that complex but extracting data from an id does seem flaky to me.

BTW, do we really want to allow dnd within the file dialogs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that are enhancements to current functionality - nice to haves tree issues related to the tree (ex: tree widget)
Projects
None yet
Development

No branches or pull requests

3 participants