Skip to content

Commit f117d6b

Browse files
committed
fix(method-snippets): fix method snippets in some rare cases (don't use getContextualType as sometimes it was returning any)
hard to test this case
1 parent 0eab0b8 commit f117d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

typescript/src/constructMethodSnippet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default (languageService: ts.LanguageService, sourceFile: ts.SourceFile,
88
if (!node || isTypeNode(node)) return
99

1010
const typeChecker = languageService.getProgram()!.getTypeChecker()!
11-
const type = typeChecker.getContextualType(node as any) ?? typeChecker.getTypeAtLocation(node)
11+
const type = typeChecker.getTypeAtLocation(node)
1212
const signatures = typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call)
1313
if (signatures.length === 0) return
1414
const signature = signatures[0]

0 commit comments

Comments
 (0)