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

New delegate command to handle paste events #2349

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

datho7561
Copy link
Contributor

  • Add the command java.edit.handlePasteEvent to handle modifying paste
    events
  • Add logic to modify paste events when the user pastes into a
    StringLiteral

Signed-off-by: David Thompson davthomp@redhat.com

@eclipse-ls-bot
Copy link

Can one of the admins verify this patch?

datho7561 added a commit to datho7561/vscode-java that referenced this pull request 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 datho7561 marked this pull request as ready for review November 28, 2022 20:49
datho7561 added a commit to datho7561/vscode-java that referenced this pull request 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 pull request 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 pull request 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 pull request 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 pull request 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>
Comment on lines 59 to 61
if (object instanceof LinkedTreeMap) {
return gson.fromJson(gson.toJson(object), clazz);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LinkedTreeMap is internal to gson so we should avoid using it, mainly because it generates some warnings. However, you don't even need to use this if the client converts the object to a JSON string prior to sending in the delegate handler. In that case it'll be handled by the object instanceof String json from below.

I'll make the change.

- Add the command `java.edit.handlePasteEvent` to handle modifying paste
  events
- Add logic to modify paste events when the user pastes into a
  `StringLiteral`

Signed-off-by: David Thompson <davthomp@redhat.com>
rgrunber pushed a commit to datho7561/vscode-java that referenced this pull request 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 rgrunber merged commit 34a63d0 into eclipse-jdtls:master Dec 22, 2022
@rgrunber rgrunber added this to the Early January 2023 milestone Dec 22, 2022
rgrunber pushed a commit to redhat-developer/vscode-java that referenced this pull request 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>
@datho7561 datho7561 deleted the 1249-paste-into-string branch January 3, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants