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

Classpath for Gradle API not recognized with developing Gradle plugins using Gradle init. #1257

Open
BenHunt-io opened this issue Jul 22, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@BenHunt-io
Copy link

BenHunt-io commented Jul 22, 2022

Extension Name: vscode-gradle
Extension Version: 3.12.2
OS Version: Mac OS Monterey 12.4
VSCode version: 1.69.2

Describe the bug
VSCode acts like the Gradle API's are not on the classpath when using gradle init to develop gradle plugins.
VSCode does not recogonize org.gradle.api.* classes.

To Reproduce

My sample project is here: https://github.com/BenHunt-io/gradle-classpath-vscode-issue

gradle-classpath-vscode-issue % gradle init

Select type of project to generate:
  1: basic
  2: application
  3: library
  4: Gradle plugin
Enter selection (default: basic) [1..4] 4

Select implementation language:
  1: Groovy
  2: Java
  3: Kotlin
Enter selection (default: Java) [1..3] 2

Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2] 1

Generate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no]yesProject name (default: gradle-classpath-vscode-issue):
Source package (default: gradle.classpath.vscode.issue):

> Task :init
Get more help with your project: https://docs.gradle.org/7.4.2/userguide/custom_plugins.html

BUILD SUCCESSFUL in 25s
2 actionable tasks: 2 executed

Expected behavior

I expect VSCode to recognize org.gradle.api.* classes.

Screenshots
Screen Shot 2022-07-22 at 10 10 17 AM
Screen Shot 2022-07-22 at 10 11 34 AM
Screen Shot 2022-07-22 at 10 13 53 AM

Output from "Gradle for Java"
You can find this by clicking on the "Output" panel, then selecting the "Gradle for Java" channel from the dropdown.

Does the bug still exist if you disable all other extensions?
Yes

Additional context
Add any other context about the problem here.

@BenHunt-io BenHunt-io added the bug Something isn't working label Jul 22, 2022
@adam-thorpe
Copy link

Seeing similar issues when upgrading to gradle 7.5. Reverting to gradle 7.4.2 fixed this issue for me

@BenHunt-io
Copy link
Author

@adam-thorpe

I also fixed it by upgrading to Gradle 7.5.1 using HomeBrew on MacOS

@CsCherrYY
Copy link
Collaborator

It's a bug about redhat.java extension, since vscode-gradle does nothing about the classpath.

Besides, I'm curious about this bug. @BenHunt-io did you simply fix it by upgrading the wrapper (by modifying /gradle/wrapper/gradle-wrapper.properties) and not cleaning java language server workspace?

@BenHunt-io
Copy link
Author

I rebuilt the wrapper, using gradle wrapper, after upgrading grade on my local filesystem. I can't say or not whether I cleaned or didn't clean the workspace.. but I do know I cleaned the workspace on 7.4.2 and it didn't do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants