diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index e8d7eed736..c25d983775 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -96,12 +96,8 @@ TestCompletionsAfterKeywordsInBlock TestCompletionsAsserts TestCompletionsAtIncompleteObjectLiteralProperty TestCompletionsClassPropertiesAfterPrivateProperty -TestCompletionsConditionalMember TestCompletionsECMAPrivateMemberTriggerCharacter TestCompletionsGeneratorFunctions -TestCompletionsGenericIndexedAccess1 -TestCompletionsGenericIndexedAccess2 -TestCompletionsGenericIndexedAccess6 TestCompletionsImportDefaultExportCrash1 TestCompletionsImport_promoteTypeOnly2 TestCompletionsImport_umdDefaultNoCrash2 @@ -120,8 +116,6 @@ TestCompletionsNamespaceName TestCompletionsNewTarget TestCompletionsNonExistentImport TestCompletionsObjectLiteralMethod6 -TestCompletionsObjectLiteralUnionStringMappingType -TestCompletionsObjectLiteralUnionTemplateLiteralType TestCompletionsOptionalKindModifier TestCompletionsOptionalMethod TestCompletionsOverridingMethod1 @@ -140,7 +134,6 @@ TestCompletionsPaths_pathMapping TestCompletionsPaths_pathMapping_nonTrailingWildcard1 TestCompletionsPaths_pathMapping_parentDirectory TestCompletionsPropertiesPriorities -TestCompletionsPropertiesWithPromiseUnionType TestCompletionsRecommended_union TestCompletionsRedeclareModuleAsGlobal TestCompletionsSelfDeclaring1 @@ -150,7 +143,6 @@ TestCompletionsSymbolMembers TestCompletionsTriggerCharacter TestCompletionsUniqueSymbol1 TestCompletionsWithDeprecatedTag3 -TestCompletionsWithOptionalPropertiesGenericPartial3 TestCompletionsWithStringReplacementMode1 TestGetJavaScriptCompletions1 TestGetJavaScriptCompletions10 diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index 2bb33dee37..c2a5739e47 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -466,7 +466,12 @@ func verifyCompletionsAreExactly(t *testing.T, prefix string, actual []*lsproto. func verifyCompletionItem(t *testing.T, prefix string, actual *lsproto.CompletionItem, expected *lsproto.CompletionItem) { ignoreKind := cmp.FilterPath( func(p cmp.Path) bool { - return p.Last().String() == ".Kind" + switch p.Last().String() { + case ".Kind", ".SortText": + return true + default: + return false + } }, cmp.Ignore(), ) @@ -474,6 +479,7 @@ func verifyCompletionItem(t *testing.T, prefix string, actual *lsproto.Completio if expected.Kind != nil { assertDeepEqual(t, actual.Kind, expected.Kind, prefix+" Kind mismatch") } + assertDeepEqual(t, actual.SortText, core.OrElse(expected.SortText, ptrTo(string(ls.SortTextLocationPriority))), prefix+" SortText mismatch") } func getExpectedLabel(t *testing.T, item ExpectedCompletionItem) string { diff --git a/internal/fourslash/tests/gen/completionsConditionalMember_test.go b/internal/fourslash/tests/gen/completionsConditionalMember_test.go index 7d23e2ced3..7927fee961 100644 --- a/internal/fourslash/tests/gen/completionsConditionalMember_test.go +++ b/internal/fourslash/tests/gen/completionsConditionalMember_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsConditionalMember(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `declare function f( p: { a: T extends 'foo' ? { x: string } : { y: string } } diff --git a/internal/fourslash/tests/gen/completionsGenericIndexedAccess1_test.go b/internal/fourslash/tests/gen/completionsGenericIndexedAccess1_test.go index 916c91ca5a..1236ced9c4 100644 --- a/internal/fourslash/tests/gen/completionsGenericIndexedAccess1_test.go +++ b/internal/fourslash/tests/gen/completionsGenericIndexedAccess1_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsGenericIndexedAccess1(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `interface Sample { addBook: { name: string, year: number } diff --git a/internal/fourslash/tests/gen/completionsGenericIndexedAccess2_test.go b/internal/fourslash/tests/gen/completionsGenericIndexedAccess2_test.go index eb608d0f29..02ec459511 100644 --- a/internal/fourslash/tests/gen/completionsGenericIndexedAccess2_test.go +++ b/internal/fourslash/tests/gen/completionsGenericIndexedAccess2_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsGenericIndexedAccess2(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `export type GetMethodsForType = { [K in keyof T]: T[K] extends () => any ? { name: K, group: G, } : T[K] extends (s: infer U) => any ? { name: K, group: G, payload: U } : never }[keyof T]; diff --git a/internal/fourslash/tests/gen/completionsGenericIndexedAccess6_test.go b/internal/fourslash/tests/gen/completionsGenericIndexedAccess6_test.go index 9786ed3dc3..3b713ebcf9 100644 --- a/internal/fourslash/tests/gen/completionsGenericIndexedAccess6_test.go +++ b/internal/fourslash/tests/gen/completionsGenericIndexedAccess6_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsGenericIndexedAccess6(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @Filename: component.tsx interface CustomElements { diff --git a/internal/fourslash/tests/gen/completionsObjectLiteralUnionStringMappingType_test.go b/internal/fourslash/tests/gen/completionsObjectLiteralUnionStringMappingType_test.go index 8f354e4fe6..9335886a82 100644 --- a/internal/fourslash/tests/gen/completionsObjectLiteralUnionStringMappingType_test.go +++ b/internal/fourslash/tests/gen/completionsObjectLiteralUnionStringMappingType_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsObjectLiteralUnionStringMappingType(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `type UnionType = { key1: string; diff --git a/internal/fourslash/tests/gen/completionsObjectLiteralUnionTemplateLiteralType_test.go b/internal/fourslash/tests/gen/completionsObjectLiteralUnionTemplateLiteralType_test.go index 0431cc923e..0d99cb0df5 100644 --- a/internal/fourslash/tests/gen/completionsObjectLiteralUnionTemplateLiteralType_test.go +++ b/internal/fourslash/tests/gen/completionsObjectLiteralUnionTemplateLiteralType_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsObjectLiteralUnionTemplateLiteralType(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `type UnionType = { key1: string; diff --git a/internal/fourslash/tests/gen/completionsPropertiesWithPromiseUnionType_test.go b/internal/fourslash/tests/gen/completionsPropertiesWithPromiseUnionType_test.go index afad88c0e6..ca4e03f7c5 100644 --- a/internal/fourslash/tests/gen/completionsPropertiesWithPromiseUnionType_test.go +++ b/internal/fourslash/tests/gen/completionsPropertiesWithPromiseUnionType_test.go @@ -10,7 +10,7 @@ import ( func TestCompletionsPropertiesWithPromiseUnionType(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @strict: true type MyType = { diff --git a/internal/fourslash/tests/gen/completionsWithOptionalPropertiesGenericPartial3_test.go b/internal/fourslash/tests/gen/completionsWithOptionalPropertiesGenericPartial3_test.go index 4ff647559a..c5e9b6f4bb 100644 --- a/internal/fourslash/tests/gen/completionsWithOptionalPropertiesGenericPartial3_test.go +++ b/internal/fourslash/tests/gen/completionsWithOptionalPropertiesGenericPartial3_test.go @@ -11,7 +11,7 @@ import ( func TestCompletionsWithOptionalPropertiesGenericPartial3(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @strict: true interface Foo {