eclipse.jdt.ls
eclipse.jdt.ls copied to clipboard
Need more predictable import behavior
JDT LS relies on importing projects into a workspace. This works fine for small-ish projects following conventions. However, it gets more complicated when a project is found with multiple different build types (eg. pom.xml and Gradle files).
The current state is confusing:
- In VS Code it's possible to disable Maven/Gradle importer via VS Code specific settings file.
- There seems to be additional support in VS Code settings file to tweak import behavior (eg.,
java.import.exclusions
). - There is a PDE extension which started to create its own
javaConfig.json
file to "configure" the importer. - We have a similar need in our Bazel JDT LS extension and dislike the idea of starting yet another config file.
- I have not yet discovered what
java.configuration.updateBuildConfiguration
does.
It would be great if JDT LS had a way to provide a file in the source code tree that has import instructions for JDT LS. This would work across different IDEs/editors because it's a concept of JDT LS. It could also "warn" any extension that a specific importer (eg., PDE/Bazel) is missing.
Proposal:
- Add support for reading
.settings/java.json
(same syntax/format as VS Codesettings.json
) - Make parsed settings from
.settings/java.json
available to importers during import - Add importer definition/pre-selection capability to
.settings/java.json
- Add existing import tweaks to
.settings/java.json
Questions:
- [ ]
.settings/
or.eclipse/
?