The Language Server keeps saying my .java files aren't on the classpath. I am using Gradle 4.10. Initially I started with the standard Groovy based build files, but decided to give Kotlin (.kts) a go. The Groovy based Gradle build files were recognized by the language server, but it doesn't seem to be picking up any information from the build.gradle.kts files. Is this supported? Everything builds without error from command line when using .kts files.
I have some time to try and tackle this, however I am not clear on where the implementation details lay here. I see the references in extension.ts to the Gradle build files, but I don't see where these files get handled. How does vscode know where to look for external jars downloaded via Gradle? I can't seem to find any other references to Gradle that deal with where vscode-java looks for classpath.
Most of the work requires the jdt.ls server to support kotlin-based gradle files, that means buildship needs to provide proper kotlin support in the 1st place.
But I'm not sure we want to add gradle kotlin support to jdt.ls OOTB (for technical and legal reasons), so it might be enabled through an extension.
I suggest you 1st make sure gradle+kotlin is something viable in Eclipse. Then we can provide further pointers on how to try to make it work in jdt.ls+vscode.
FYI, on the jdt.ls side, gradle support starts with https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/managers/GradleBuildSupport.java
need, this plugin is useless without it, imho.
and honestly, all I need is for it to get the classpath appropriately, I couldn't care less about it parsing the kotlin file right now...
FWIW .kts build files seem to work OK in Eclipse now. Is it time to take another look at this maybe?
@akaroml @testforstephen @Eskibear @jdneo is this something you guys can look at?
We'll have a chat with our linkedIn partners first and then see whether to raise the priority.
Hi all. Are there any updates on this issue? I see this has been open since 2018. Is this really still up for consideration? Or is this falling into the void of "won't ever implement"? Either answer is fine, I'd just like to know where it stands. VS Code seems to be becoming the odd one out in terms of kts support in gradle projects.
Most helpful comment
Hi all. Are there any updates on this issue? I see this has been open since 2018. Is this really still up for consideration? Or is this falling into the void of "won't ever implement"? Either answer is fine, I'd just like to know where it stands. VS Code seems to be becoming the odd one out in terms of kts support in gradle projects.