JDT LS Extension builds on 2023-12 and supports JDT LS from 2024-03

This commit is contained in:
aboyko
2024-04-15 17:49:42 -04:00
parent 95b8e2f5bd
commit fc0ed8840f
2 changed files with 11 additions and 4 deletions

View File

@@ -10,13 +10,14 @@
*******************************************************************************/
package org.springframework.tooling.jdt.ls.extension;
import java.lang.reflect.Method;
import java.net.URI;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.internal.ui.viewsupport.CoreJavaElementLinks;
import org.eclipse.jdt.ls.core.internal.javadoc.JavaElementLinks;
import org.eclipse.jdt.ls.core.internal.IDelegateCommandHandler;
import org.springframework.tooling.jdt.ls.commons.java.JavaData;
@@ -34,7 +35,13 @@ public class JavadocHoverLinkHandler implements IDelegateCommandHandler {
if (element != null) {
// Bug in JDT server one '(' not encoded while everything else in the query is
// encoded
return CoreJavaElementLinks.createURI(null, element).replace("(", "%28");
try {
Class<?> clazz = getClass().getClassLoader().loadClass("org.eclipse.jdt.internal.ui.viewsupport.CoreJavaElementLinks");
Method method = clazz.getDeclaredMethod("createURI", String.class, IJavaElement.class);
return method.invoke(null, null, element);
} catch (Exception e) {
return JavaElementLinks.createURI(null, element).replace("(", "%28");
}
}
} catch (Exception e) {
JdtLsExtensionPlugin.getInstance().getLog().error("Failed to compute java data for " + bindingKey + " in project " + uri, e);

View File

@@ -97,14 +97,14 @@
<repository>
<id>eclipse-2023-09</id>
<layout>p2</layout>
<url>https://download.eclipse.org/releases/2024-03</url>
<url>https://download.eclipse.org/releases/2023-12</url>
</repository>
<repository>
<id>JDT.LS</id>
<layout>p2</layout>
<!-- <url>${jdt.ls.updatesite}</url> -->
<url>https://download.eclipse.org/jdtls/milestones/1.34.0/repository/</url>
<url>https://download.eclipse.org/jdtls/milestones/1.30.1/repository/</url>
<!-- <url>https://download.eclipse.org/jdtls/snapshots/repository/latest/</url> -->
<!-- The latest JDT LS requires a JDK 17, so we need to run builds on a JDK 17 and raise the minimum level to JDK 17 -->
<!-- In order to avoid this for the 2022-06-based release, I set the JDK LS version here to the latest milestone that does NOT require JDK 17 yet -->