Auto completion for Set , List, Map not working well after today's update

Issue #2205 resolved
Nagendra Singh created an issue

Earlier when we typed List<String> strList= and press ctrl+space , the first option would be to prefill the line and complete the declaration with parameterized value.

List<String> strList = new List<String>();

But now it only gives below options.

IntelliJ IDEA 2022.2.2 (Ultimate Edition)
Build #IU-222.4167.29, built on September 13, 2022
Runtime version: 17.0.4+7-b469.53 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Non-Bundled Plugins:
com.intellij.selenium (222.4167.21)
Pythonid (222.4167.37)
com.illuminatedcloud2.intellij (2.2.3.7)
com.haulmont.jpab (2022.4.1-222)

Kotlin: 222-1.7.10-release-334-IJ4167.29

Official response

  • Scott Wells repo owner

    Okay, this is the same build as yesterday (2.2.3.7) but with the specialized constructor completions for parameterized collection types included.

    To install it, please download the attached archive (but don't extract it) and use Settings / Preferences > Plugins > Install plugin from disk (under the gear drop-down menu). Allow the IDE to restart and let me know if that doesn't make things right again.

    Assuming so, I'll plan to include this in either next week's standard build on Thursday or, if more and more people are running into the issue, an early patch build on Monday.

Comments (10)

  1. Scott Wells repo owner

    Ugh…well, that’s not what I wanted. I’ll see about turning about a quick restoration of the original completion capability for collection types. So sorry for the oversight! Thank you for reporting.

  2. Scott Wells repo owner

    Okay, this is the same build as yesterday (2.2.3.7) but with the specialized constructor completions for parameterized collection types included.

    To install it, please download the attached archive (but don't extract it) and use Settings / Preferences > Plugins > Install plugin from disk (under the gear drop-down menu). Allow the IDE to restart and let me know if that doesn't make things right again.

    Assuming so, I'll plan to include this in either next week's standard build on Thursday or, if more and more people are running into the issue, an early patch build on Monday.

  3. Jason Clark

    @Scott Wells Minor issue I’ve noted since this was resolved; please let me know if you’d like me to open a new issue.

    Before the changes, the “specialized constructor completions” completion for Map, List, and Set were always sorted at the top. To the point that I just type Map<Id, SObject> someMap = new Ma[TAB], knowing that pressing TAB after Ma would get me the correct completion.

    Since the fix, sometimes I get other completions sorting first, and I have to check which completion is selected before pressing tab. Here are a couple of examples.

    It would be helpful if the constructor completions could always take precedence.

  4. Scott Wells repo owner

    Jason, for efficiency reasons, right now IC2 isn’t ordering offered completions by assignability score based on the expected data type, at least not for basic code completions (Ctrl+Space). Smart code completions (Ctrl+Shift+Space) are filtered by assignability score, though, so that should yield the correct subset of completions. Having said that, the Map issue still exists even with smart completion due to a bug that I’ve fixed locally where it was actually seeing Component.Apex.Map as System.Map in one specific situation that comes into play when computing assignability scores. That won’t likely be in tomorrow’s build as the book is pretty much closed on it, but I should be able to get it into next week’s build.

    I’ll also see if there’s a way I can order the highest-ranked code completions even during basic completions by assignability which would make those appear first without introducing broad scoring overhead during that less filtered completion phase.

  5. Scott Wells repo owner

    FYI, I was able to prioritize based on assignability even in basic completions, at least when completing constructors to minimize when that overhead is added. I’ll play around a bit and see if I can do so more broadly without penalty. As I said previously, these fixes/enhancements won’t be in tomorrow’s build but should in next week’s build.

  6. Scott Wells repo owner

    Okay, I actually went WAY beyond where I thought I would get on this work and now even basic completions are ordered based on assignability, proximity, match vs. the current insertion point, etc. That should be included in next week’s build if things go smoothly with all of the Winter ‘23 updates. If not, it’ll be in the following week’s build.

  7. Log in to comment