Skip to content
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

Add opportunistic support for Java/Kotlin polyglot Android projects #2261

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

nisargjhaveri
Copy link
Contributor

  • Support Android projects even if they apply kotlin plugin
  • Kotlin is not supported by jdt.ls, but it could be supported by an extension to the ls
  • Even if Kotlin is not supported, Java code in project can still benefit from the support

FYI @CsCherrYY, @jdneo

- Support Android projects even if they apply kotlin plugin
- Kotlin is not supported by jdt.ls, but it could be supported by an extension to the ls
- Even if Kotlin is not supported, Java code in project can still benefit from the support

Signed-off-by: Nisarg Jhaveri <[email protected]>
@jdneo
Copy link
Contributor

jdneo commented Oct 8, 2022

We disabled it on purpose at first. Because we don't want to introduce any confusion to users.

At least for now, the polyglot (Java + Kotlin) projects are now supported well.

Even if Kotlin is not supported, Java code in project can still benefit from the support

Yes, but when it comes to that, the Java code and Kotlin code reference each other, things will become tricky.

My personal opinion is that the benefit of this change not clear to me.

@nisargjhaveri
Copy link
Contributor Author

More details.

Kotlin is not supported by jdt.ls, but it could be supported by an extension to the ls

There is an experimental extension, which extends jdt.ls by providing Kotlin LS as well to support Java+Kotlin projects. If we don't allow Android support if Kotlin plugin is applied, even if kotlin support is otherwise available, it won't work as expected.

Even if Kotlin is not supported, Java code in project can still benefit from the support

The previous case is the target case where Kotlin is already available from some extension. In case user has not enabled Kotlin support (not installed required extensions), this doesn't hurt much in my opinion. It is very clear that this language server only support Java. I've also seen many projects where the kotlin plugin is applied, but most, if not all of the code is in Java. This might not be an optimal experience, but gives more choice to the user in my opinion.

@jdneo
Copy link
Contributor

jdneo commented Oct 10, 2022

@CsCherrYY WDYT?

@CsCherrYY
Copy link
Contributor

The propose to disable the android support on projects having kotlin plugin is not to introduce much noise to users, as @jdneo mentioned. Besides, I think this change is acceptable since:

  • JDTLS now reports errors for non-Android Java/Kotlin polyglot projects, it keeps consistent if we do the same thing for Android projects.
  • I'm glad to hear that vscode-java-kotlin provides experimental Java/Kotlin support. JDTLS would be happy to not block the polyglot support to collect more feedback, since the Android support in JDTLS is at the experimental stage as well.

@CsCherrYY CsCherrYY merged commit f6af517 into eclipse-jdtls:master Oct 13, 2022
@rgrunber rgrunber added this to the End October milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants