Skip to content

Quick fixes are ordered badly #4203

Closed
Closed

Description

@DanTup

Screenshot 2022-10-06 at 16 02 42

I would expect all ignores to be further down, and the "add import" to further up. Not sure if it's VS Code's new menu or a server issue.

Activity

  1. added this to the v3.52.0 milestone on Oct 6, 2022
  2. DanTup commented on Oct 31, 2022

    @DanTup
    MemberAuthor

    🤔

    Screenshot 2022-10-31 at 11 58 11

    Using a recent bleeding-edge build.

  3. DanTup commented on Oct 31, 2022

    @DanTup
    MemberAuthor

    Screenshot 2022-10-31 at 11 59 19

    2.18.0

  4. DanTup commented on Oct 31, 2022

    @DanTup
    MemberAuthor

    Seems to depend on the specific text.. changing var back to Uint8List triggers it:

    Screenshot 2022-10-31 at 12 20 40

    This seems to be match the order from the server:

    {
    	"id": 134,
    	"jsonrpc": "2.0",
    	"result": [
    		{
    			"kind": "source.sortMembers",
    			"title": "Sort Members"
    		},
    		{
    			"kind": "source.organizeImports",
    			"title": "Organize Imports"
    		},
    		{
    			"kind": "source.fixAll",
    			"title": "Fix All"
    		},
    		{
    			"kind": "refactor.extract",
    			"title": "Extract Method"
    		},
    		{
    			"kind": "refactor.extract",
    			"title": "Extract Local Variable"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.create.localVariable",
    			"title": "Create local variable 'Uint8List'"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.remove.unusedLocalVariable",
    			"title": "Remove unused local variable"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.ignore.line",
    			"title": "Ignore 'prefer_final_locals' for this line"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.ignore.line",
    			"title": "Ignore 'unused_local_variable' for this line"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.ignore.file",
    			"title": "Ignore 'prefer_final_locals' for this file"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.ignore.file",
    			"title": "Ignore 'unused_local_variable' for this file"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.create.class",
    			"title": "Create class 'Uint8List'"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.create.mixin",
    			"title": "Create mixin 'Uint8List'"
    		},
    		{
    			"diagnostics": [],
    			"edit": {},
    			"kind": "quickfix.import.librarySdk",
    			"title": "Import library 'dart:typed_data'"
    		}
    	]
    }
  5. DanTup commented on Oct 31, 2022

    @DanTup
    MemberAuthor

    The cause of this was that we de-dupe when there are overlapping fixes on the same line. The de-duping code created a new "combined" CodeAction which was not storing its priority properly, and always being sorted last.

    Fix at https://dart-review.googlesource.com/c/sdk/+/266680.

  6. modified the milestones: v3.52.0, v3.54.0 on Oct 31, 2022
  7. DanTup commented on Oct 31, 2022

    @DanTup
    MemberAuthor
  8. modified the milestones: v3.54.0, v3.52.0 on Oct 31, 2022
  9. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Oct 31, 2022
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 featuresis 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