Skip to content

Duplicate completion items #6003

Closed
Closed

Description

@DanTup
Image

Activity

  1. added this to the v3.134.0 milestone on Mar 25, 2026
  2. FMorschel commented on Mar 26, 2026

    @FMorschel
    Contributor

    This seems a lot like dart-lang/sdk#60188, but interestingly enough this class has generics. Does it also reproduce for classes without type parameters?

  3. DanTup commented on Mar 31, 2026

    @DanTup
    MemberAuthor

    It seems to be related to type aliases. There's a lot of typedefs like:

    typedef StaticOptions = Either2<bool, String>;
    

    And we seem to walk type aliases suggest the target constructors (presumably without anything checking they haven't already been added). I'm not sure why we do this if we're going to use the target name though (it would make more sense if they showed up as StaticOptions.t1.

    Ideally these typedefs wouldn't even be public, but I think they're needed because they're used in public signatures.

    Edit: Smaller repro:

    Image
    class Foooooooo {
      Foooooooo.x();
    }
    
    typedef Bar1 = Foooooooo;
    typedef Bar2 = Foooooooo;
    typedef Bar3 = Foooooooo;
    
    var id = Foo^
  4. FMorschel commented on Mar 31, 2026

    @FMorschel
    Contributor

    Oh, I definetly remember seing something around type alias when fixing dart-lang/sdk#61244. So the fix would probably be around that area too if you want to remove those. But I'd actually prefer (as you suggested) we use the type alias name for the completion items. Since sometimes the alias is the only way to access the type (for whatever reason someone might do that).

    //c.dart
    class _C {}
    
    typedef Class = _C;
    
    void f(Class c) {}
    
    //other.dart
    import 'c.dart';
    
    void main() => f(Cla^);
  5. DanTup commented on Mar 31, 2026

    @DanTup
    MemberAuthor
  6. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Mar 31, 2026
  7. DanTup commented on Apr 6, 2026

    @DanTup
    MemberAuthor

    Fixed by dart-lang/sdk@931a3ff, ships in the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions