mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Fix quick info for methods whose contextual type is a mapped type property (#33930)
This commit is contained in:
@@ -237,7 +237,7 @@ namespace ts.SymbolDisplay {
|
||||
// get the signature from the declaration and write it
|
||||
const functionDeclaration = <FunctionLike>location.parent;
|
||||
// Use function declaration to write the signatures only if the symbol corresponding to this declaration
|
||||
const locationIsSymbolDeclaration = find(symbol.declarations, declaration =>
|
||||
const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, declaration =>
|
||||
declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration));
|
||||
|
||||
if (locationIsSymbolDeclaration) {
|
||||
|
||||
9
tests/cases/fourslash/quickInfoMappedTypeMethods.ts
Normal file
9
tests/cases/fourslash/quickInfoMappedTypeMethods.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
// https://github.com/microsoft/TypeScript/issues/32983
|
||||
|
||||
////type M = { [K in 'one']: any };
|
||||
////const x: M = {
|
||||
//// /**/one() {}
|
||||
////}
|
||||
|
||||
verify.quickInfoAt("", "(property) one: any");
|
||||
Reference in New Issue
Block a user