Replies: 13 comments 46 replies
-
You may want to try and compare with https://github.com/georgewfraser/java-language-server , your feedback would be welcome. Do you have any proposal of concrete parser generator/frameworks that could be used instead of jikespg in JDT Core? Is the parser output all internal and hidden behind an API, so one could try another one nd all changes would remain internal? |
Beta Was this translation helpful? Give feedback.
-
Both NetBeans and georgewfraser/java-language-server are built on top of javac. Using javac as AST parser is one direction we want to explore. |
Beta Was this translation helpful? Give feedback.
-
@mpalat This is probably interesting topic for you too. |
Beta Was this translation helpful? Give feedback.
-
I'm drafting a "framework" to make progress on this topic, basically ensuring we can run unit tests that just try to parse a very minimal file with Javac so we can then "fill the holes" in the code with some new JavacASTConverter-like class. @testforstephen I believe you were also working, or planning to work, on this topic. Is there some possible collaboration at this stage already? |
Beta Was this translation helpful? Give feedback.
-
I've tried a few more experiments:
I'm going to investigate the following:
|
Beta Was this translation helpful? Give feedback.
-
I also mentioned it in eclipse-jdt/eclipse.jdt.core#1234 (comment) , but with upcoming |
Beta Was this translation helpful? Give feedback.
-
@mickaelistria Oracle announced a Language-Server based on Javac here: even though they mention VSCode I wonder if this can be used in eclipse or even other LS servers (like jdt-ls) to perform some work. |
Beta Was this translation helpful? Give feedback.
-
It requires that the whole project is built properly. |
Beta Was this translation helpful? Give feedback.
-
Here is a followup issue on JDT Core about moving from ECJ to Javac: eclipse-jdt/eclipse.jdt.core#1827 |
Beta Was this translation helpful? Give feedback.
-
@mickaelistria I do see now JDT LS use a jdt.core incubating version, does that means usage of Javac is already used in jdt.ls ? |
Beta Was this translation helpful? Give feedback.
-
@mickaelistria @rgrunber and others, Should we build a separate LS nightly version with the changes ongoing for integrating Javac changes? The reason I'm asking is, I would very much like to explore the possibility of implementing completions based on some sort of javac based parser take a different approach than what is taken in JDT.Core completion parser. I'm assuming all the magic happens in Netbeans starting at this class https://github.com/apache/netbeans/blob/master/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java, which I find very straight forward to maintain and anyone can add new functionality provided the Parser is updated. WDYT ? |
Beta Was this translation helpful? Give feedback.
-
To try it out in vscode-java, you can manually install a recent vscode-java.vsix I regularly upload to https://github.com/fbricon/vscode-java/releases/
If you want to build it locally:
The completion is still delegated to ECJ, as we haven't started providing a replacement based on javac yet. |
Beta Was this translation helpful? Give feedback.
-
Hi All,
Given that most of the stakeholders behind JDT.LS doesn't focus on Eclipse Java IDE from what I can see, I have the following thoughts which I would like to have a discussion around.
Today JDT.LS use JDT.Core underneath for implement LS support for Java. JDT.Core comes with a long history and therefore the design might be bit of complex to move forward faster. As result the movement of JDT.LS requires lot of effort.
If we think about stability, JDT has some issues around when it comes the Java Parser and AST resolution which brings issues time to time mostly in Completions but also in Compilation as well. One issues that I observe is the Parser implementation has become some what complex and only known by few who has worked from the beginning. It takes lot of time to investigate an issue and provide fix for a new developer in this area.
Now one suggestion I have is, What if we start to look at using a more modern parser which is actively maintain ? We could start to use it in LS for completions, then diagnostics which will provide us the opportunity add new features easily by designing it better from what we have learned so far.
For the compiler part, we could keep on using Eclipse JDT Compiler or look for Javac if we don't see any issues not using JDT Compiler. I know that JDT compiler is fast and more memory efficient, But considering effort we have to put to maintain it while Java team already provides a compiler, Should we spend that time on improving the LS for better Java Editing experience ?
We could still use the Eclipse JDT Indexer as it is if we could wire all the events to trigger indexing.
Lets discuss ...
Beta Was this translation helpful? Give feedback.
All reactions