Skip to content

Commit

Permalink
fix: use newer JDT.LS's JavadocContentAccess2 methods
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Jan 29, 2024
1 parent 3bdae6b commit 6ea798e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions quarkus.jdt.ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.version>3.0.5</tycho.version>
<tycho.version>4.0.4</tycho.version>
<tycho.extras.version>${tycho.version}</tycho.extras.version>
<tycho.scmUrl>scm:git:https://github.com/redhat-developer/quarkus-ls</tycho.scmUrl>
<tycho.generateSourceReferences>true</tycho.generateSourceReferences>
<jdt.ls.version>1.29.0-SNAPSHOT</jdt.ls.version>
<jdt.ls.version>1.32.0-SNAPSHOT</jdt.ls.version>
<tycho.test.platformArgs />
<tycho.test.jvmArgs>-Xmx2G -DDetectVMInstallationsJob.disabled=true ${tycho.test.platformArgs}</tycho.test.jvmArgs>
<lsp4mp.p2.url>https://download.eclipse.org/lsp4mp/snapshots/0.10.0/repository/</lsp4mp.p2.url>
<lsp4mp.p2.url>https://download.eclipse.org/lsp4mp/snapshots/0.11.0/repository/</lsp4mp.p2.url>

<!-- Code coverage -->
<jacoco.version>0.8.8</jacoco.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions qute.jdt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.version>3.0.5</tycho.version>
<tycho.version>4.0.4</tycho.version>
<tycho.extras.version>${tycho.version}</tycho.extras.version>
<tycho.scmUrl>scm:git:https://github.com/redhat-developer/quarkus-ls</tycho.scmUrl>
<tycho.generateSourceReferences>true</tycho.generateSourceReferences>
<jdt.ls.version>1.29.0-SNAPSHOT</jdt.ls.version>
<jdt.ls.version>1.32.0-SNAPSHOT</jdt.ls.version>
<tycho.test.platformArgs />
<tycho.test.jvmArgs>-Xmx512m -DDetectVMInstallationsJob.disabled=true ${tycho.test.platformArgs}</tycho.test.jvmArgs>

Expand Down

0 comments on commit 6ea798e

Please sign in to comment.