glsp icon indicating copy to clipboard operation
glsp copied to clipboard

Improve Copy/Paste/Clipboard support

Open CamilleLetavernier opened this issue 5 years ago • 0 comments

Currently, the Copy/Paste is implemented using a custom client-side clipboard API. As we noticed when implementing a version of the Copy/Paste using the Eclipse Clipboard, in the Eclipse integration, this API is not flexible enough (It's not easy to move to a different clipboard without rewriting entirely new actions/handlers).

This ticket is about clarifying the use cases we want to support; and then updating the API to support these cases. Some of the open questions and comments:

  • Which clipboard do we want to use in the Browser? When integrating into a Desktop IDE? In-memory clipboard vs System clipboard vs Browser clipboard.
  • Do we want to support cross-editor Copy/Paste? Cross-application in the same integration? Cross-application from IDE to Cloud? (This relates directly to the clipboard question above)
  • Browser clipboard permission: for security reason, it's not possible to read the clipboard programatically in the Browser (We have to use the Paste shortcut). In IDE integration, there is no such limitation; so when integrating e.g. the Browser in a Desktop IDE, we can prefer the IDE Clipboard API
  • Which format should we use for the clipboard? Currently, we use application/json rather than plain text; which means it's not possible to e.g. copy from/to a text file (Note that it's not an XOR, we can use both)
  • In terms of API, currently the client is responsible for handling the Clipboard; which is probably fine in most cases, but is annoying specifically for IDE integration, where the IDE should be responsible for handling the Clipboard (It has unrestricted access to the Clipboard API). While client-side clipboard will probably remain the main use case, we should probably still support server-side clipboard (At least in terms of API/Extensibility).

CamilleLetavernier avatar Nov 23 '20 08:11 CamilleLetavernier