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

Add drop into editor API #142990

Closed
mjbvz opened this issue Feb 14, 2022 · 4 comments · Fixed by #155102
Closed

Add drop into editor API #142990

mjbvz opened this issue Feb 14, 2022 · 4 comments · Fixed by #155102
Assignees
Labels
api api-finalization feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan
Milestone

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 14, 2022

Exploration of dragging a file from VS Code's explorer into an editor to create a link. Example use case would be dragging a file into a markdown editor to insert a link

@mjbvz mjbvz added the feature-request Request for new features or functionality label Feb 14, 2022
@mjbvz mjbvz added this to the February 2022 milestone Feb 14, 2022
@mjbvz mjbvz self-assigned this Feb 14, 2022
@mjbvz mjbvz added the api label Feb 17, 2022
@mjbvz mjbvz changed the title Explore creating links by dragging and dropping from VS Code explorer Explore api that lets extensions creating links by handling drops of files dragged from the VS Code explorer Feb 17, 2022
@mjbvz
Copy link
Collaborator Author

mjbvz commented Feb 17, 2022

I have a prototype but need to think more about what the design should look like. Biggest question I have right now:

Should we allow there to be multiple of these drop handlers active at one time? We do want to allow there to be multiple drop handlers where each one handles a different dropped mime type, but what about multiple handlers for a single mime type? In markdown for example, you can imagine having one drop handler that creates links and another that creates image links

If we did allow this, presumably we then need some way for the user to control what happens on drop, either with a setting to configure the default or by presenting a list of actions to them


Answering this helps determines if we go with more of a provider style api or more of an event api

mjbvz added a commit that referenced this issue Feb 18, 2022
#142990

This prototypes a semi-provider based api handle dragging and dropping. I went with this approach over a purely event based one because:

- Most extensions will likely only care about a specific language

- It gives us more structure to handle what happens if there are multiple drag and drop providers active. This prototype doesn't handle this at all, but you can imagine getting shown ui to select the action when the drop happens
mjbvz added a commit that referenced this issue Feb 18, 2022
#142990

This prototypes a semi-provider based api handle dragging and dropping. I went with this approach over a purely event based one because:

- Most extensions will likely only care about a specific language

- It gives us more structure to handle what happens if there are multiple drag and drop providers active. This prototype doesn't handle this at all, but you can imagine getting shown ui to select the action when the drop happens
@mjbvz mjbvz modified the milestones: February 2022, March 2022 Feb 22, 2022
mjbvz added a commit that referenced this issue Mar 18, 2022
mjbvz added a commit that referenced this issue Mar 18, 2022
* Add drop into editor api proposal

For #142990

* Use AsyncEmitter
@mjbvz mjbvz modified the milestones: March 2022, April 2022 Mar 25, 2022
mjbvz added a commit that referenced this issue Apr 4, 2022
mjbvz added a commit that referenced this issue Apr 4, 2022
@mjbvz
Copy link
Collaborator Author

mjbvz commented Apr 4, 2022

@misolori @sbatten I've added some basic prompt text to the drop overlay:

Untitled.mov

This text only shows up when you are dropping into the whole editor. It hides itself if the drop is previewing a split (however holding down shift still lets you enter "drop into editor" mode)

Let me know what you think about this behavior. I also think we need to make the Hold shift to drop into editor text more prominent, potentially by adding a solid background to it. Would appreciate some design help and suggestions on this

@sbatten
Copy link
Member

sbatten commented Apr 5, 2022

Yea the visual presentation of the text is my main call for improvement. Both in terms of prominence and using the key presentation we have in the command palette
Screen Shot 2022-04-05 at 10 39 36 AM

@mjbvz mjbvz changed the title Explore api that lets extensions creating links by handling drops of files dragged from the VS Code explorer Add drop into editor API May 18, 2022
@mjbvz mjbvz modified the milestones: May 2022, June 2022 May 24, 2022
mjbvz added a commit to mjbvz/vscode that referenced this issue Jun 8, 2022
This updates the text editor drop proposal (microsoft#142990). This change introduces `DocumentDropEdit` which removes the need for `SnippetTextEdit`. This interface may also be extended in the future with additional metadata
mjbvz added a commit that referenced this issue Jun 8, 2022
This updates the text editor drop proposal (#142990). This change introduces `DocumentDropEdit` which removes the need for `SnippetTextEdit`. This interface may also be extended in the future with additional metadata
@mjbvz mjbvz modified the milestones: June 2022, July 2022 Jun 14, 2022
mjbvz added a commit to mjbvz/vscode that referenced this issue Jul 13, 2022
mjbvz added a commit that referenced this issue Jul 13, 2022
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jul 13, 2022
Yoyokrazy pushed a commit to Yoyokrazy/vscode that referenced this issue Jul 13, 2022
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 14, 2022
andreamah pushed a commit that referenced this issue Jul 14, 2022
jrieken pushed a commit that referenced this issue Jul 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 2022
Dgggreevj referenced this issue in microsoft/vscode-extension-samples Jun 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-finalization feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants