mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
parent
38477bf5f5
commit
b247c10516
|
@ -72,7 +72,7 @@ class ManagedCodeActionSet extends Disposable implements CodeActionSet {
|
|||
|
||||
private static codeActionsComparator({ action: a }: CodeActionItem, { action: b }: CodeActionItem): number {
|
||||
if (isNonEmptyArray(a.diagnostics)) {
|
||||
return -1;
|
||||
return isNonEmptyArray(b.diagnostics) ? ManagedCodeActionSet.codeActionsPreferredComparator(a, b) : -1;
|
||||
} else if (isNonEmptyArray(b.diagnostics)) {
|
||||
return 1;
|
||||
} else {
|
||||
|
|
|
@ -119,9 +119,9 @@ suite('CodeAction', () => {
|
|||
disposables.add(registry.register('fooLang', provider));
|
||||
|
||||
const expected = [
|
||||
// CodeActions with a diagnostics array are shown first ordered by diagnostics.message
|
||||
new CodeActionItem(testData.diagnostics.abc, provider),
|
||||
// CodeActions with a diagnostics array are shown first without further sorting
|
||||
new CodeActionItem(testData.diagnostics.bcd, provider),
|
||||
new CodeActionItem(testData.diagnostics.abc, provider),
|
||||
|
||||
// CodeActions without diagnostics are shown in the given order without any further sorting
|
||||
new CodeActionItem(testData.command.abc, provider),
|
||||
|
|
Loading…
Reference in a new issue