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

paste a multi-line string should create a java string #1249

Closed
maxandersen opened this issue Jan 18, 2020 · 6 comments · Fixed by #2703
Closed

paste a multi-line string should create a java string #1249

maxandersen opened this issue Jan 18, 2020 · 6 comments · Fixed by #2703

Comments

@maxandersen
Copy link
Contributor

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 :)

@akaroml
Copy link
Contributor

akaroml commented Feb 17, 2020

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.

@datho7561
Copy link
Contributor

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 added a commit to datho7561/vscode-java that referenced this issue Sep 26, 2022
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Sep 26, 2022
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Sep 27, 2022
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
@rgrunber
Copy link
Member

rgrunber commented Oct 6, 2022

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.

datho7561 added a commit to datho7561/vscode-java that referenced this issue Nov 25, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Nov 28, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Nov 28, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Nov 28, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Nov 29, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Dec 1, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Dec 1, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Dec 12, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-java that referenced this issue Dec 12, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
rgrunber pushed a commit to datho7561/vscode-java that referenced this issue Dec 22, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes redhat-developer#1249

Signed-off-by: David Thompson <davthomp@redhat.com>
rgrunber pushed a commit that referenced this issue Dec 22, 2022
- Invoke jdt.ls's `java.edit.handlePasteEvent` command when vscode-java
  receives a paste event

Requires eclipse-jdtls/eclipse.jdt.ls#2349
Closes #1249

Signed-off-by: David Thompson <davthomp@redhat.com>
@rgrunber rgrunber added this to the Early January 2023 milestone Dec 22, 2022
@fbricon
Copy link
Collaborator

fbricon commented Jan 17, 2023

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

@gakkiyomi
Copy link

"editor.experimental.pasteActions.enabled": true

i have no this settings in my vscode

@rgrunber
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants