From 5537050de136f916efff02f96c578fe2b92973e3 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:46:34 -0700 Subject: [PATCH] Update find-all-refs and related test 1. Some special-case code in find-all-refs is no longer relevant. 2. Using the real symbol gives names to more class expressions, so I made the expression more complex to keep the class truly anonymous in goToImplementationInterface_07. The quick info display also changes, from ``` (anonymous local class) ``` to ``` (local class) (Anonymous class) ``` This is more consistent internally and externally, so I think it's a good change. --- src/services/findAllReferences.ts | 6 ------ tests/cases/fourslash/goToImplementationInterface_07.ts | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index d11a447b142..0144267f76e 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -508,12 +508,6 @@ namespace ts.FindAllReferences { displayParts: [punctuationPart(SyntaxKind.OpenParenToken), textPart("object literal"), punctuationPart(SyntaxKind.CloseParenToken)] }; } - else if (node.kind === SyntaxKind.ClassExpression) { - return { - kind: ScriptElementKind.localClassElement, - displayParts: [punctuationPart(SyntaxKind.OpenParenToken), textPart("anonymous local class"), punctuationPart(SyntaxKind.CloseParenToken)] - }; - } else { return { kind: getNodeKind(node), displayParts: [] }; } diff --git a/tests/cases/fourslash/goToImplementationInterface_07.ts b/tests/cases/fourslash/goToImplementationInterface_07.ts index 3ebf76d1e3e..d07d219683c 100644 --- a/tests/cases/fourslash/goToImplementationInterface_07.ts +++ b/tests/cases/fourslash/goToImplementationInterface_07.ts @@ -19,7 +19,7 @@ //// let x7: (new() => Foo) = [|class { hello () { /**constructorType*/} }|]; //// let x8: Foo[] = [|[{ hello () { /**arrayType*/} }]|]; //// let x9: { y: Foo } = [|{ y: { hello () { /**typeLiteral*/} } }|]; -//// let x10 = [|{|"parts": ["(","anonymous local class",")"], "kind": "local class"|}class implements Foo { hello() {} }|] +//// let x10 = [ [|{|"parts": ["(","local class",")"," ", "(Anonymous class)"], "kind": "local class"|}class implements Foo { hello() {} }|] ] //// let x11 = class [|{|"parts": ["(","local class",")"," ","C"], "kind": "local class"|}C|] implements Foo { hello() {} } //// //// // Should not do anything for type predicates