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

Allow switching how content is dropped #179430

Closed
mjbvz opened this issue Apr 7, 2023 · 3 comments
Closed

Allow switching how content is dropped #179430

mjbvz opened this issue Apr 7, 2023 · 3 comments
Assignees
Labels
api api-proposal feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 7, 2023

Related to #156384

When multiple drop providers are registered, we should allow selecting which one is used on drop. This includes letting users fall back to dropping the item as plaintext

Main requirements:

  • When dropping into an editor, if multiple drop edits are returned, apply the best automatically by default but then show some sort of UI to change how the contents are dropping
  • Add a setting so that users can configure the default drop provider per language
@mjbvz mjbvz added the api label Apr 7, 2023
@mjbvz mjbvz added this to the April 2023 milestone Apr 7, 2023
@mjbvz mjbvz self-assigned this Apr 7, 2023
@mjbvz mjbvz added the feature-request Request for new features or functionality label Apr 7, 2023
@mjbvz
Copy link
Collaborator Author

mjbvz commented Apr 7, 2023

Learnings from this also apply to copy paste providers

Will likely require some API additions to:

  • Give drops a human readable name to show in the UI
  • Give drops a id that we can use in the settings

mjbvz added a commit to mjbvz/vscode that referenced this issue Apr 7, 2023
For microsoft#179430

Adds two new UX components:

- An inline progress icon shown when a drop operation takes over 500ms. This replaces the notification. You can click on it to cancel the drop

- Post drop, a drop feedback icon that lets you drop the file in a different way. This lets you drop the file as plain text for instance instead of as a markdown link
mjbvz added a commit to mjbvz/vscode that referenced this issue Apr 11, 2023
For microsoft#179430

Adds two new UX components:

- An inline progress icon shown when a drop operation takes over 500ms. This replaces the notification. You can click on it to cancel the drop

- Post drop, a drop feedback icon that lets you drop the file in a different way. This lets you drop the file as plain text for instance instead of as a markdown link
mjbvz added a commit that referenced this issue Apr 11, 2023
For #179430

Adds two new UX components:

- An inline progress icon shown when a drop operation takes over 500ms. This replaces the notification. You can click on it to cancel the drop

- Post drop, a drop feedback icon that lets you drop the file in a different way. This lets you drop the file as plain text for instance instead of as a markdown link
@mjbvz mjbvz modified the milestones: April 2023, May 2023 Apr 24, 2023
@mjbvz mjbvz modified the milestones: May 2023, June 2023 May 25, 2023
@mjbvz mjbvz modified the milestones: June 2023, July 2023 Jun 12, 2023
@mjbvz mjbvz modified the milestones: July 2023, August 2023 Jul 18, 2023
mjbvz added a commit that referenced this issue Aug 8, 2023
For #179430, #30066

Switching to use `yieldTo` instead of `priority` to let an extension de-rank itself in the list of edits. `priority` was an arbitrary number while `yieldTo` gives more control over how the ranking takes place
mjbvz added a commit that referenced this issue Aug 8, 2023
Move await from `priority` for drop/paste API proposals

For #179430, #30066

Switching to use `yieldTo` instead of `priority` to let an extension de-rank itself in the list of edits. `priority` was an arbitrary number while `yieldTo` gives more control over how the ranking takes place
mjbvz added a commit to mjbvz/vscode that referenced this issue Aug 8, 2023
For microsoft#179430, microsoft#30066

This lets us call just the provider we are interested in
mjbvz added a commit that referenced this issue Aug 8, 2023
For #179430, #30066

This lets us call just the provider we are interested in
@mjbvz mjbvz modified the milestones: August 2023, September 2023 Aug 22, 2023
@mjbvz mjbvz added this to the On Deck milestone Nov 13, 2023
@mjbvz mjbvz modified the milestones: On Deck, March 2024 Mar 11, 2024
@mjbvz mjbvz modified the milestones: March 2024, April 2024 Mar 25, 2024
@mjbvz mjbvz modified the milestones: April 2024, May 2024 Apr 22, 2024
@mjbvz mjbvz modified the milestones: May 2024, June 2024 May 23, 2024
@mjbvz mjbvz modified the milestones: June 2024, July 2024 Jun 17, 2024
@mjbvz mjbvz modified the milestones: July 2024, August 2024 Jul 16, 2024
@mjbvz mjbvz modified the milestones: August 2024, September 2024 Aug 19, 2024
@mjbvz mjbvz modified the milestones: September 2024, On Deck Sep 20, 2024
@mjbvz
Copy link
Collaborator Author

mjbvz commented Nov 14, 2024

This has been implemented using the editor.dropIntoEditor.preferences setting and drop into UI

Tracking finalization for the related extension API in #30066

@mjbvz mjbvz closed this as completed Nov 14, 2024
@mjbvz mjbvz modified the milestones: On Deck, November 2024 Nov 14, 2024
@mjbvz
Copy link
Collaborator Author

mjbvz commented Nov 14, 2024

To verify:

  • In a md file, try dragging and dropping a file from the VS Code explorer into the editor. Confirm you can use the drop widget to change how it is inserted

  • Now set editor.dropIntoEditor.preferences to something like [ "uri.absolute" ]. Confirm that dropping into markdown now inserts the full path by default but you can still use the widget to change drop types

@mjbvz mjbvz added the verification-needed Verification of issue is requested label Nov 14, 2024
@benibenj benibenj added verified Verification succeeded server and removed server labels Dec 3, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-proposal feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants