From 6ea798ee2b8cebf9d2a5cd609d5be2721cec4077 Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Fri, 26 Jan 2024 18:54:19 +0100 Subject: [PATCH] fix: use newer JDT.LS's JavadocContentAccess2 methods Signed-off-by: Fred Bricon --- .github/workflows/tests.yml | 8 +++++--- .../META-INF/MANIFEST.MF | 2 +- quarkus.jdt.ext/pom.xml | 6 +++--- .../redhat/qute/jdt/template/TemplateGetJavadocTest.java | 2 +- .../com/redhat/qute/jdt/internal/ls/JDTUtilsLSImpl.java | 3 +-- qute.jdt/pom.xml | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4d8dee9f..d06a1e398 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,17 +5,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache .m2 repository - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2/repository key: maven-repository-${{ hashFiles('**/pom.xml') }} + save-always: true - name: Cache Maven wrapper - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2/wrapper key: maven-wrapper-${{ hashFiles('**/mvnw') }} + save-always: true - name: Set up Eclipse Temurin JDK 17 uses: actions/setup-java@v2 with: diff --git a/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus/META-INF/MANIFEST.MF b/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus/META-INF/MANIFEST.MF index fc6847306..3337affa5 100644 --- a/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus/META-INF/MANIFEST.MF +++ b/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus/META-INF/MANIFEST.MF @@ -5,7 +5,7 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: com.redhat.microprofile.jdt.quarkus;singleton:=true Bundle-Version: 0.18.0.qualifier -Require-Bundle: org.eclipse.lsp4mp.jdt.core, +Require-Bundle: org.eclipse.lsp4mp.jdt.core;bundle-version="0.11.0", org.eclipse.core.runtime, org.eclipse.jdt.core, org.eclipse.jdt.core.manipulation, diff --git a/quarkus.jdt.ext/pom.xml b/quarkus.jdt.ext/pom.xml index bf3bfa5af..97af2e77b 100644 --- a/quarkus.jdt.ext/pom.xml +++ b/quarkus.jdt.ext/pom.xml @@ -10,14 +10,14 @@ UTF-8 UTF-8 - 3.0.5 + 4.0.4 ${tycho.version} scm:git:https://github.com/redhat-developer/quarkus-ls true - 1.29.0-SNAPSHOT + 1.32.0-SNAPSHOT -Xmx2G -DDetectVMInstallationsJob.disabled=true ${tycho.test.platformArgs} - https://download.eclipse.org/lsp4mp/snapshots/0.10.0/repository/ + https://download.eclipse.org/lsp4mp/snapshots/0.11.0/repository/ 0.8.8 diff --git a/qute.jdt/com.redhat.qute.jdt.test/src/main/java/com/redhat/qute/jdt/template/TemplateGetJavadocTest.java b/qute.jdt/com.redhat.qute.jdt.test/src/main/java/com/redhat/qute/jdt/template/TemplateGetJavadocTest.java index d6a5381df..7616f9f53 100644 --- a/qute.jdt/com.redhat.qute.jdt.test/src/main/java/com/redhat/qute/jdt/template/TemplateGetJavadocTest.java +++ b/qute.jdt/com.redhat.qute.jdt.test/src/main/java/com/redhat/qute/jdt/template/TemplateGetJavadocTest.java @@ -90,7 +90,7 @@ public void getMethodJavadocPlainText() throws Exception { DocumentFormat.PlainText); String actual = QuteSupportForTemplate.getInstance().getJavadoc(params, getJDTUtils(), new NullProgressMonitor()); - String expected = " Returns the derived items. \n * Returns:\n - the derived items"; + String expected = " Returns the derived items. Returns:\nthe derived items\n";// Updated jdt.ls JavaDoc2PlainTextConverter doesn't yield great results anymore assertEquals(expected, actual); } diff --git a/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/internal/ls/JDTUtilsLSImpl.java b/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/internal/ls/JDTUtilsLSImpl.java index 051fb8b44..f1afef346 100644 --- a/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/internal/ls/JDTUtilsLSImpl.java +++ b/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/internal/ls/JDTUtilsLSImpl.java @@ -31,7 +31,6 @@ import org.eclipse.jdt.ls.core.internal.ResourceUtils; import org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler; import org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers; -import org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess; import org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess2; import org.eclipse.lsp4j.Location; import org.eclipse.lsp4j.Range; @@ -116,7 +115,7 @@ public Location toLocation(IJavaElement element) throws JavaModelException { public String getJavadoc(IMember member, DocumentFormat documentFormat) throws JavaModelException { boolean markdown = DocumentFormat.Markdown.equals(documentFormat); Reader reader = markdown ? JavadocContentAccess2.getMarkdownContentReader(member) - : JavadocContentAccess.getPlainTextContentReader(member); + : JavadocContentAccess2.getPlainTextContentReader(member); return reader != null ? toString(reader) : null; } diff --git a/qute.jdt/pom.xml b/qute.jdt/pom.xml index 42062c643..1a5b37117 100644 --- a/qute.jdt/pom.xml +++ b/qute.jdt/pom.xml @@ -12,11 +12,11 @@ UTF-8 UTF-8 - 3.0.5 + 4.0.4 ${tycho.version} scm:git:https://github.com/redhat-developer/quarkus-ls true - 1.29.0-SNAPSHOT + 1.32.0-SNAPSHOT -Xmx512m -DDetectVMInstallationsJob.disabled=true ${tycho.test.platformArgs}