I develop a vscode extension.
I would like to decect user action for copy and cut on the editor.
I checked API reference, but I could not find the method.
How can I do this in extensions with typescript ?
You are right, there is no API for that, and by VSCode Approach to Extensibility, you may be out of luck.
I had tried to replace the original Copy and Cut commands, but ended up creating new commands and adding instructions to the user to replace the keybindings, when I created my Copy Word in Cursor extension. I had issues because VSCode itself does not publish a Clipboard object (compared to Atom), so I had to do myself, using node-copy-paste package.
Unless they have changed its idea (try to open an issue on VSCode repo), you should create new Copy and Cut commands to accomplish what your extension needs to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With