Skip to content

"Dart: Sort Members" reorders members but not inline comments #3697

@LeoBound

Description

@LeoBound

Describe the bug
soruce.sortMembers reorders variables but not inline comments.

To Reproduce
Paste this into a dart file:

var variableA; //A
var variableC; //C
var variableB; //B

Press CTRL + Shift + P and run Dart: Sort Members.

The same behaviour occurs if you have "source.sortMembers": true in your "editor.codeActionsOnSave" in your VSCode settings.

Expected behavior

var variableA; //A
var variableC; //C
var variableB; //B

should be sorted to

var variableA; //A
var variableB; //B
var variableC; //C

but instead is sorted to

var variableA; //A
var variableB; //C
var variableC; //B

Versions (please complete the following information):

  • VS Code version: 1.62.3
  • Dart extension version: v3.28.0
  • Dart/Flutter SDK version: Dart 2.14.4/ Flutter 2.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)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