vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

paste a multi-line string should create a java string

Open maxandersen opened this issue 5 years ago • 1 comments

try paste this into a string, i.e. between two quotes "":

SELECT payment_date, amount, sum(amount) OVER (ORDER BY payment_date)
FROM (
  SELECT CAST(payment_date AS DATE) AS payment_date, SUM(amount) AS amount
  FROM payment
  GROUP BY CAST(payment_date AS DATE)
) p
ORDER BY payment_date;

in eclipse it becomes a valid java string in vscode it generates non-compilable code.

Would be great if vscode could help here :)

maxandersen avatar Jan 18 '20 22:01 maxandersen

Since the Paste event is now available to extension, we can definitely provide some help here. @jdneo please also help track this in the area of adopting editor events.

akaroml avatar Feb 17 '20 03:02 akaroml

It looks like the relevant API is still just a proposal (https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts), but I'll see if I can get a prototype working. (Also, maybe I'm looking in the wrong place)

datho7561 avatar Sep 26 '22 16:09 datho7561

Looks like we're waiting for this to become API (as opposed to just proposed API). I think we should just slowly polish our PR, see if it handles our use-case nicely, and then inquire about the time frame for making it API.

rgrunber avatar Oct 06 '22 15:10 rgrunber

You need to set "editor.experimental.pasteActions.enabled": true for this to work. i.e. Screenshot 2023-01-17 at 08 58 14

fbricon avatar Jan 17 '23 07:01 fbricon

"editor.experimental.pasteActions.enabled": true

i have no this settings in my vscode

gakkiyomi avatar Nov 30 '23 02:11 gakkiyomi

I think the paste action setting has been replaced by editor.pasteAs.enabled. It should default to enabled though. See https://github.com/microsoft/vscode/pull/181375 .

rgrunber avatar Nov 30 '23 02:11 rgrunber