Skip to content

Sort members command deletes comment from import #2762

Closed

Description

@gkrawiec

On a .dart file, the comments to the right of an import get deleted when running the sort members command.

this is the minimal file with which I was able to reproduce it.

import '../a.dart'; //test
import '../b.dart';

after I run the Sort Members command the comment //test gets deleted.

If I only have a single import directive, the comment does NOT disappear. Only happens with 2 or more imports.

[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G2021, locale en-US)
 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc4)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.48.2)

Let me know if you need any other info.
thanks.

Activity

  1. added this to the v3.15.0 milestone on Sep 2, 2020
  2. DanTup commented on Sep 2, 2020

    @DanTup
    Member

    Thanks for the report! I think this is the same as dart-lang/sdk#42515 but Sort Members and Organize Imports have their own code paths so they need to be consolidated so Sort Members also gets this fix.

  3. DanTup commented on Sep 7, 2020

    @DanTup
    Member
  4. DanTup commented on Sep 22, 2020

    @DanTup
    Member

    Fixed by dart-lang/sdk@d3b0979. You won't see the fix until you're on an updated SDK that includes that change.

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 editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions