fix: add ViewerComparator compatibility workaround for Outline view#1516
fix: add ViewerComparator compatibility workaround for Outline view#1516rubenporras merged 1 commit intoeclipse-lsp4e:mainfrom
Conversation
|
@rubenporras : I have to validate the fix with older SDK, just quickly coded that without testing for now. |
org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/CNFOutlinePage.java
Outdated
Show resolved
Hide resolved
|
I've created a target platform for Eclipse 4.38 and LSP4E (unfortunately, GitHub doesn't accept *.target files, so I added the code below). @iloveeclipse, your code doesn't compile using that target since target-platform-438.target <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="LSP4E Target-platform Eclipse 4.38">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.lsp4j" version="0.0.0"/>
<unit id="org.eclipse.lsp4j.jsonrpc" version="0.0.0"/>
<unit id="org.eclipse.lsp4j.debug" version="0.0.0"/>
<unit id="org.eclipse.lsp4j.jsonrpc.debug" version="0.0.0"/>
<unit id="com.google.gson" version="0.0.0"/>
<repository location="https://download.eclipse.org/lsp4j/updates/releases/1.0.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.ide" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2025-12/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.ui.tests.harness" version="0.0.0"/>
<repository location="https://download.eclipse.org/eclipse/updates/4.38/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2025-12/"/>
<unit id="org.commonmark" version="0.0.0"/>
<unit id="org.commonmark.ext-gfm-tables" version="0.0.0"/>
<unit id="com.google.guava" version="0.0.0"/>
<unit id="com.google.guava.failureaccess" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.tm4e.feature.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/tm4e/releases/0.17.2/"/>
</location>
<location includeDependencyDepth="none" includeDependencyScopes="compile" missingManifest="error" type="Maven">
<dependencies>
<dependency>
<groupId>com.vegardit.no-npe</groupId>
<artifactId>no-npe-eea-all</artifactId>
<version>1.3.9</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
</target> |
Sure, it is a workaround, but it compiles with current lsp4e target (whatever it is). The point is, it should work at runtime but not force lsp4e to change the target (for now). Whatever lsp4e decides regarding target handling is not part of this change / ticket. |
|
@iloveeclipse, what I mean is, it doesn't work with Eclipse 4.38. I created an Eclipse 4.38 target to check your work-around and it doesn't work (doesn't compile), since the class If we just roll back the original PR #1512, the code compiles / works with Eclipse 4.38 and with Eclipse 4.39 (the current LSP4E target). |
That is clear, but this is not my goal here, because it will cause troubles later once the |
|
Ok, now I understand your approach. You still compile against Eclipse 4.39 (having |
|
Unfortunately current fix doesn't work. I still see the same error, looks like the class name is stored in the constant pool of the class even if it is only used in the method. I will try to provide something better. |
92a9730 to
cc2c0ab
Compare
Something strange happens here. In Eclipse patches work, but binaries produced by lsp4e Jenkins build don't work, looks like different compiler settings. This makes testing extremely hard... |
CommonViewerComparator was introduced in Eclipse 4.39 and so Outline can't use this class on older Eclipse versions. Let use old CommonViewerSorter for compatibility with older Eclipse releases. See eclipse-platform/eclipse.platform.ui#3621 Fixes eclipse-lsp4e#1515
|
Finally, last build works on 4.38. |
|
Hi @iloveeclipse , thank you for the work. I will merge and do a new release. |
CommonViewerComparator was introduced in Eclipse 4.39 and so Outline can't use this class on older Eclipse versions. Let use old CommonViewerSorter for compatibility with older Eclipse releases.
See eclipse-platform/eclipse.platform.ui#3621
Fixes #1515