Skip to content

Conversation

ljfa-ag
Copy link

@ljfa-ag ljfa-ag commented Sep 3, 2025

Groovy method calls where the method name is an interpolated string (for example "${foo}"(...)) are currently causing NPEs in various places. Autocompletion doesn't work in the entire file when such a call is used anywhere in a build.gradle file. The problem is that "MethodCallExpression.getMethodAsString()" returns null for these dynamic method calls.

I have mostly moved constant strings to the front of equals comparisons to avoid the NPEs. In some cases I have replaced "getMethodAsString()" by "getMethod().getText()", which is not null.

This fixes #1562.

@ljfa-ag
Copy link
Author

ljfa-ag commented Sep 3, 2025

@microsoft-github-policy-service agree

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.

Gradle autocompletion (ctrl + space) fails with error
1 participant