kontext-e / AutoFillingCallArguments

This IntelliJ IDEA plugin guesses the call parameters by the callee parameter names.
Apache License 2.0
22 stars 11 forks source link

No longer working in IntelliJ 2023.3.2 (or earlier) #6

Closed CymricNPG closed 1 month ago

CymricNPG commented 8 months ago

After updating to IntelliJ 2023.3.2 the plugin no longer works. After selecting "Auto fill call parameter" nothing happens. No errors are logged.

It looks like the API has changed. Previously context.getItemsToShow() retuned CandidateInfo, now it returns MethodParameterInfoHandler.CandidateWithPresentation which is a private class. Also, JetBrains added a new function to get the CandidateInfo. A new collector would look like this now:

        return DumbService.getInstance(project).computeWithAlternativeResolveEnabled(
                () -> getParameterInfoHandlers(project, file, language).stream()
                        .map(handler -> handler.findElementForParameterInfo(context))
                        .filter(Objects::nonNull)
                        .flatMap(element -> Arrays.stream(context.getItemsToShow()))
                        .map(MethodParameterInfoHandler::tryGetMethodFromCandidate)
                        .filter(Objects::nonNull)
                        .filter(PsiMethod::hasParameters)
                        .toList());

I haven't yet tested it with all possible method-calls, there maybe some more changes.

songxianpeng commented 7 months ago
IntelliJ IDEA 2023.3.2 (Ultimate Edition)
Build #IU-233.13135.103, built on December 20, 2023
Licensed to gurgles tumbles
You have a perpetual fallback license for this version.
Subscription is active until September 14, 2026.
Runtime version: 17.0.9+7-b1087.9 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.3
GC: G1 Young Generation, G1 Old Generation
Memory: 8192M
Cores: 12
Metal Rendering is ON
Registry:
  editor.distraction.free.mode=true
  ide.experimental.ui=true
Kotlin: 233.13135.103-IJ

Is there any progress on this issue? also not work on my version

CymricNPG commented 5 months ago

I made a fix, you can manually install it from here: https://github.com/CymricNPG/AutoFillingCallArguments/releases/tag/1.2.1

Adussess commented 2 months ago

I made a fix, you can manually install it from here: https://github.com/CymricNPG/AutoFillingCallArguments/releases/tag/1.2.1

It worked, thanks

JensNercheKE commented 1 month ago

Thanks for the PR, is merged.