eclipse.jdt.ls
eclipse.jdt.ls copied to clipboard
[WIP] Run tests against javac bits
The idea is to run
mvn clean verify -Pjavac
But for some reason I run into:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath (default-validate-classpath) on project org.eclipse.jdt.ls.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath failed: org.osgi.framework.BundleException: Bundle org.eclipse.jdt.ls.tests cannot be resolved:org.eclipse.jdt.ls.tests [293] [ERROR] Unresolved requirement: Require-Bundle: org.eclipse.jdt.core.javac
@akurtakov @mickaelistria what am I missing?
I got the tests running in https://ci.eclipse.org/ls/job/jdt-ls-javac/
A fix to ensure completion actually produces results. The monitor field in https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/dom-with-javac/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionEngine.java never calls beginTask or anything other than isCancelled. We use beginTask in the monitor to initialize the time at which we will call setCancelled(true). This fixes things for now.
diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandler.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandler.java
index 2610ec8a..f7861c1e 100644
--- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandler.java
+++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandler.java
@@ -268,8 +268,9 @@ public class CompletionHandler{
IBuffer buffer = unit.getBuffer();
if (buffer != null && buffer.getLength() >= offset) {
IProgressMonitor subMonitor = new ProgressMonitorWrapper(monitor) {
- private long timeLimit;
private final long TIMEOUT = Long.getLong("completion.timeout", 5000);
+ // beginTask need not be called so initialize here just in case
+ private long timeLimit = System.currentTimeMillis() + TIMEOUT;
@Override
public void beginTask(String name, int totalWork) {
@rgrunber are you sure it's related to this issue? At the moment, the DOMCompletionEngine shouldn't be turned on with other Javac feature (soon, but not yet), so the behavior shouldn't be impacted. Can you please report the issue about the monitor to the jdt-core-incubator repo? cc @datho7561
I'll fix it in the DOMCompletionEngine; I have a PR up right now since it's a ~2-3 line change
It's all disabled by default. However, if a user were to turn on the completion through DOM, they would get no results every time.
I've merged the fix to call beginTask() and done() on the progress monitor
@rgrunber Anything blocking? Can we merge it now?
mmm
[ERROR] Cannot resolve target definition:
[ERROR] Software being installed: org.eclipse.jdt.core 3.38.0.v20240515-1634
[ERROR] Software being installed: org.eclipse.jdt.core.manipulation 1.21.300.v20240918-0710
[ERROR] Only one of the following can be installed at once: [org.eclipse.jdt.core 3.40.0.v20240919-0625, org.eclipse.jdt.core 3.38.0.v20240515-1634, org.eclipse.jdt.core 3.39.0.v20240807-1632]
[ERROR] Cannot satisfy dependency: org.eclipse.jdt.core.manipulation 1.21.300.v20240918-0710 depends on: osgi.bundle; org.eclipse.jdt.core [3.39.0,4.0.0)
[ERROR]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for JDT Language Server :: Parent 1.41.0-SNAPSHOT:
[INFO]
[INFO] JDT Language Server :: Parent ...................... SUCCESS [ 0.024 s]
[INFO] JDT Language Server :: Target Platform ............. SUCCESS [ 0.004 s]
[INFO] JDT Language Server :: Core ........................ FAILURE [ 3.625 s]
I can try to rebase the JDT LS incubator to see if it helps
Any idea what's with all the test failures ? https://ci.eclipse.org/ls/job/jdt-ls-pr/5305/
Update: Ok, seems to be related to the version of ECJ that is being used to compile.. maybe I just need to bump it. Yup, ECJ bump 3.38.0.v20240524-2033 -> 3.39.0.v20240820-0604 :flying_saucer: