From 8006556b7c6126532afc6d5cb196b00e13ee0a9c Mon Sep 17 00:00:00 2001 From: Stephane Bouchet Date: Thu, 12 Oct 2023 18:06:56 +0200 Subject: [PATCH] fix application.properties completion (#238) * fix application.properties completion revertting to old jsoup because of remark Signed-off-by: Stephane Bouchet * updated memory settings Signed-off-by: Stephane Bouchet * updated memory settings Signed-off-by: Stephane Bouchet * revert Signed-off-by: Stephane Bouchet --------- Signed-off-by: Stephane Bouchet --- .github/workflows/build_test.yml | 7 ++----- plugins/org.jboss.tools.quarkus.lsp4e/META-INF/MANIFEST.MF | 2 +- plugins/org.jboss.tools.quarkus.lsp4e/pom.xml | 5 +++++ .../tools/quarkus/lsp4e/internal/ls/HtmlToPlainText.java | 6 ++++-- .../lsp4e/internal/ls/JavaDoc2MarkdownConverter.java | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 33956b75..203de207 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -37,6 +37,7 @@ jobs: architecture: x64 distribution: 'temurin' cache: maven + # Install Maven 3.9 - name: Set up Maven uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f #v4.5 @@ -54,11 +55,7 @@ jobs: # Build and compile using Maven - name: Build/Compile and run unit tests - uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d #v1 - with: - run: > - mvn clean verify -U -fae --settings build-ci/maven-settings.xml -DskipITests=true - -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -ntp + run: xvfb-run -a mvn clean verify -U -fae -B --settings build-ci/maven-settings.xml -DskipITests=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -ntp # Archive artifacts to be applied in Publish Reports workflow - name: Archiving test artifacts diff --git a/plugins/org.jboss.tools.quarkus.lsp4e/META-INF/MANIFEST.MF b/plugins/org.jboss.tools.quarkus.lsp4e/META-INF/MANIFEST.MF index 163cbe69..aca190a2 100644 --- a/plugins/org.jboss.tools.quarkus.lsp4e/META-INF/MANIFEST.MF +++ b/plugins/org.jboss.tools.quarkus.lsp4e/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.lsp4e, org.eclipse.jdt.core.manipulation, org.eclipse.jdt.ui, org.eclipse.lsp4mp.jdt.core, - org.jsoup;bundle-version="1.8.3";visibility:=reexport, org.eclipse.ui, org.jboss.tools.foundation.ui, org.apache.commons.lang3, @@ -35,6 +34,7 @@ Bundle-ClassPath: ., server/org.eclipse.lsp4mp.ls-uber.jar, server/com.redhat.quarkus.ls.jar, lib/remark.jar, + lib/jsoup.jar, server/com.redhat.qute.ls-uber.jar Bundle-Activator: org.jboss.tools.quarkus.lsp4e.QuarkusLSPPlugin Export-Package: org.jboss.tools.quarkus.lsp4e diff --git a/plugins/org.jboss.tools.quarkus.lsp4e/pom.xml b/plugins/org.jboss.tools.quarkus.lsp4e/pom.xml index 4b9df47e..7944bfdf 100644 --- a/plugins/org.jboss.tools.quarkus.lsp4e/pom.xml +++ b/plugins/org.jboss.tools.quarkus.lsp4e/pom.xml @@ -81,6 +81,11 @@ remark 1.2.0 + + org.jsoup + jsoup + 1.9.2 + diff --git a/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/HtmlToPlainText.java b/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/HtmlToPlainText.java index d0642bd7..baae5217 100644 --- a/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/HtmlToPlainText.java +++ b/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/HtmlToPlainText.java @@ -23,7 +23,7 @@ */ package org.jboss.tools.quarkus.lsp4e.internal.ls; -import org.jsoup.internal.StringUtil; +import org.jsoup.helper.StringUtil; import org.jsoup.nodes.Element; import org.jsoup.nodes.Node; import org.jsoup.nodes.TextNode; @@ -46,7 +46,9 @@ public class HtmlToPlainText { */ public String getPlainText(Element element) { FormattingVisitor formatter = new FormattingVisitor(); - NodeTraversor.traverse(formatter, element); // walk the DOM, and call .head() and .tail() for each node + NodeTraversor traversor = new NodeTraversor(formatter); + traversor.traverse(element); // walk the DOM, and call .head() and .tail() for each node + return formatter.toString(); } diff --git a/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/JavaDoc2MarkdownConverter.java b/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/JavaDoc2MarkdownConverter.java index f26e2123..fbda0b08 100644 --- a/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/JavaDoc2MarkdownConverter.java +++ b/plugins/org.jboss.tools.quarkus.lsp4e/src/org/jboss/tools/quarkus/lsp4e/internal/ls/JavaDoc2MarkdownConverter.java @@ -17,7 +17,7 @@ import org.jboss.tools.quarkus.lsp4e.QuarkusLSPPlugin; import org.jsoup.safety.Cleaner; -import org.jsoup.safety.Safelist; +import org.jsoup.safety.Whitelist; import com.overzealous.remark.Options; import com.overzealous.remark.Options.Tables; @@ -50,7 +50,7 @@ public class JavaDoc2MarkdownConverter extends AbstractJavaDocConverter { Field safelistField = Cleaner.class.getDeclaredField("safelist"); safelistField.setAccessible(true); - Safelist s = (Safelist) safelistField.get(c); + Whitelist s = (Whitelist) safelistField.get(c); s.addProtocols("a", "href", "file", "jdt"); s.addProtocols("img", "src", "file");