Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fixes are ordered badly #4203

Closed
DanTup opened this issue Oct 6, 2022 · 5 comments
Closed

Quick fixes are ordered badly #4203

DanTup opened this issue Oct 6, 2022 · 5 comments
Labels
in editor Relates to code editing or language features is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Oct 6, 2022

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.

@DanTup DanTup added is bug in editor Relates to code editing or language features labels Oct 6, 2022
@DanTup DanTup added this to the v3.52.0 milestone Oct 6, 2022
@DanTup
Copy link
Member Author

DanTup commented Oct 31, 2022

🤔

Screenshot 2022-10-31 at 11 58 11

Using a recent bleeding-edge build.

@DanTup
Copy link
Member Author

DanTup commented Oct 31, 2022

Screenshot 2022-10-31 at 11 59 19

2.18.0

@DanTup
Copy link
Member Author

DanTup commented Oct 31, 2022

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'"
		}
	]
}

@DanTup
Copy link
Member Author

DanTup commented Oct 31, 2022

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.

@DanTup DanTup modified the milestones: v3.52.0, v3.54.0 Oct 31, 2022
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 31, 2022
…n if de-duped

Fixes Dart-Code/Dart-Code#4203.

Change-Id: I3be943539e64481a9de2d2d2d88fa664962ef87b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266680
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member Author

DanTup commented Oct 31, 2022

Fixed by dart-lang/sdk@00ca14f.

@DanTup DanTup closed this as completed Oct 31, 2022
@DanTup DanTup modified the milestones: v3.54.0, v3.52.0 Oct 31, 2022
@DanTup DanTup added the relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

1 participant