vscode-java reports "cannot be resolved" errors in Gradle plugin project with mix of Groovy and Java
See original GitHub issueIn Gradle plugins implemented with a mix of Java and Groovy, vscode-java
reports “cannot be resolved” errors in .java
files that reference classes defined in .groovy
files. Gradle can compile and build the plugin successfully.
Environment
- Operating System: macOS 10.15.4
- JDK version:
openjdk version "13.0.2" 2020-01-14 OpenJDK Runtime Environment (build 13.0.2+8) OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
- Visual Studio Code version:
Version: 1.45.0-insider Commit: abb4a35cfc26102f93fd00df7b59ce1a19c2017a Date: 2020-04-28T05:34:21.109Z (20 hrs ago)
- Java extension version: 0.60.0
Steps To Reproduce
- Clone https://github.com/a01fe/gradle-groovy-java-plugin
cd gradle-groovy-java-plugin/test; ./gradlew javaTask
This builds the plugin and runs a task in the plugin to verify it compiles and builds successfully- Open the project in vscode and open src/main/groovy/foo/task/JavaTask.java,
vscode-java
reports errors on all the references toJavaTaskSpec
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
"Unresolved dependency" / "import cannot be resolved" in VS ...
The issue is that VSCode Language Support for Java does not recognize the dependencies / imports in build.gradle or in our Java source...
Read more >Gradle 7.0.1 Release Notes
This release enables file system watching by default to make your incremental builds faster, expands support for building projects with Java 16, and...
Read more >Groovy Language Documentation
2.5. groovydoc, the Groovy & Java documentation generator ... In particular, it is possible to combine the not operator with the Groovy truth:....
Read more >VS Code Java September 2021 Update | Foojay.io Today
Error reporting. The Gradle language server will use Groovy compile engine to analyze the Gradle build file and report syntax errors if exist....
Read more >redhat-developer - Bountysource
I've tried both Gradle and Maven. VS Code p shows me a bunch of "cannot be resolved" errors for any classes called out...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Has there been any updates since the last convo on this issue/blocker ?
Joint compilation for Groovy and Java for LSP has been discussed. Also, there may be Groovy LSP implementations already, but I am unsure about their support for joint compilation (inter-dependency) of Groovy and Java sources.