-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support using 'javac' as internal compiler. #3167
Conversation
046db5d
to
db2819f
Compare
I got the tests running in https://ci.eclipse.org/ls/job/jdt-ls-javac/ |
ea04e38
to
46fe57f
Compare
182472f
to
7ff2b84
Compare
Bundle-RequiredExecutionEnvironment: JavaSE-23 | ||
Import-Package: org.osgi.framework;version="1.3.0", | ||
org.eclipse.jdt.internal.javac, | ||
org.eclipse.jdt.internal.javac.dom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of tweaking the MANIFEST.MF, you can consider adding the javac bundle as extraRequirement
with target-platform-configuration
block in the pom.xml. This bit of customization could also be encapsulated in the javac
profile, so it can be easier to merge later.
7ff2b84
to
72443c7
Compare
pom.xml
Outdated
<profile> | ||
<id>javac</id> | ||
<properties> | ||
<tycho.testArgLine>--add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -DICompilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver -DCompilationUnit.DOM_BASED_OPERATIONS=true -DAbstractImageBuilder.compiler=org.eclipse.jdt.internal.javac.JavacCompiler</tycho.testArgLine> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now also needs
--add-opens jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets.snippet=ALL-UNNAMED --add-opens jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets=ALL-UNNAMED
<compilerArgs combine.self="override"> | ||
<arg>--add-exports</arg> | ||
<arg>java.base/java.lang=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> | ||
<arg>--add-exports</arg> | ||
<arg>jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> | ||
</compilerArgs> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might possibly be removed
72443c7
to
b2bc078
Compare
A fix to ensure completion actually produces results. The 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. |
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
I'll fix it in the |
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. |
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
I've merged the fix to call |
@rgrunber Anything blocking? Can we merge it now? |
mmm
|
7a85299
to
cfd7f2d
Compare
- Report setting through 'telemetry/event' notification - Use a JDK 23 for building - Bump ECJ to 3.39.0.v20240820-0604 - Bump target platform to match new jdt-core-incubator site Signed-off-by: Roland Grunberg <[email protected]>
cfd7f2d
to
7296d00
Compare
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
See eclipse-jdtls/eclipse.jdt.ls#3167 (comment) Signed-off-by: David Thompson <[email protected]>
The idea is to run
But for some reason I run into:
@akurtakov @mickaelistria what am I missing?