Skip to content

New delegate command to handle paste events#2349

Merged
rgrunber merged 1 commit intoeclipse-jdtls:masterfrom
datho7561:1249-paste-into-string
Dec 22, 2022
Merged

New delegate command to handle paste events#2349
rgrunber merged 1 commit intoeclipse-jdtls:masterfrom
datho7561:1249-paste-into-string

Conversation

@datho7561
Copy link
Copy Markdown
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 [email protected]

@eclipse-ls-bot
Copy link
Copy Markdown
Contributor

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 <[email protected]>
@datho7561 datho7561 force-pushed the 1249-paste-into-string branch from 8310b59 to f48765e Compare November 28, 2022 20:44
@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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
@datho7561 datho7561 force-pushed the 1249-paste-into-string branch from f48765e to 4479d74 Compare December 12, 2022 16:59
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 <[email protected]>
@datho7561 datho7561 force-pushed the 1249-paste-into-string branch from 4479d74 to b62f28c Compare December 12, 2022 21:36
Comment on lines +59 to +61
if (object instanceof LinkedTreeMap) {
return gson.fromJson(gson.toJson(object), clazz);
}
Copy link
Copy Markdown
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 <[email protected]>
@rgrunber rgrunber force-pushed the 1249-paste-into-string branch from b62f28c to 9b6d7f2 Compare December 22, 2022 01:05
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 <[email protected]>
@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 <[email protected]>
@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.

3 participants