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

No completions for method call expressions inside closures #1338

Open
gayanper opened this issue May 20, 2023 · 6 comments
Open

No completions for method call expressions inside closures #1338

gayanper opened this issue May 20, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@gayanper
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When trying to complete method call expressions, I don't get the completion items of that method call expression return value such as

spotless {
    java {
        googleJavaFormat().
    }
}

Completion behind googleJavaFormat(). This might only works up to this point after applying the PR #1337

Describe the solution you'd like
I would like to to get the list of completions for the return type of googleJavaFormat() instead of closure. One idea is to add all methods of the return type of googleJavaFormat() into the same closure list generated from GradleServer. May be we might need to change the name of the method then.

Describe alternatives you've considered
None

@gayanper gayanper added the enhancement New feature or request label May 20, 2023
@gayanper
Copy link
Contributor Author

@jdneo @testforstephen What do you think about this feature, Do you have better solution ideas ? If so let me know I could find time to implement.

@gayanper
Copy link
Contributor Author

Another approach I thought of is, the gradle plugin part which generate the closure map can also keep the actual class as well connected to each entry. And when we want to resolve methods for the type in a expression, we could send a request to gradle server which will use the closure class's classloader to load the requesing type and provide methods and fields.

I think this will be a better approach that what I described above. WDYT @jdneo @testforstephen ?

@jdneo
Copy link
Member

jdneo commented May 22, 2023

sounds like the new proposal will only calculate the completion on demand lazily, is that correct?

@gayanper
Copy link
Contributor Author

sounds like the new proposal will only calculate the completion on demand lazily, is that correct?

Yes

@jdneo
Copy link
Member

jdneo commented May 23, 2023

Thank you, it looks good to me.

@gayanper
Copy link
Contributor Author

Thanks, then i will send a PR with the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants