You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm definitely open to it. It should be pretty simple. The last thing I'd like to do is find the spot between eclipse.platform.text <===> eclipse.jdt.ui where that negative length gets corrected. It has to get corrected somewhere because platform has -1 as valid according to API, and JDT has code that will fail if that happens.
Also, I couldn't find anything in the LSP spec that explicitly states this kind of "inverted" range is invalid, though the fact that I can't easily find a bug in JDT-LS that complains about this is a good sign that clients should avoid doing this.
CC @mickaelistria
I'm using https://github.com/rgrunber/eclipse.jdt.ls.client/blob/master/com.redhat.eclipseide.jdtlsclient/src/com/redhat/eclipseide/jdtlsclient/JDTLSProductConnectionProvider.java (via. LSP4E). I noticed that the client was sending a range that JDT-LS can't handle.
https://github.com/eclipse-platform/eclipse.platform.text/blob/81a446557dd3f8f354a272de447fe787881dbe1f/org.eclipse.jface.text/src/org/eclipse/jface/text/quickassist/QuickAssistAssistant.java#L71
This results in code action requests being sent to JDT-LS which fail because for refactoring we assert the length should be >= 0 :
https://github.com/eclipse-jdt/eclipse.jdt.ui/blob/b8bdee93b96fabed18ac1f3f50c1e51c3802c010/org.eclipse.jdt.core.manipulation/core%20extension/org/eclipse/jdt/internal/corext/dom/Selection.java#L52
However, looking at https://github.com/eclipse-platform/eclipse.platform.text/blob/81a446557dd3f8f354a272de447fe787881dbe1f/org.eclipse.jface.text/src/org/eclipse/jface/text/quickassist/IQuickAssistInvocationContext.java#L38 , this is valid.
So I think this needs to be adjusted at
lsp4e/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/codeactions/LSPCodeActionQuickAssistProcessor.java
Line 224 in 89dc090
The text was updated successfully, but these errors were encountered: