buildSymbolDisplay: Handle alias parentSymbol
This commit is contained in:
parent
5e20c1ce11
commit
8894915d1a
|
@ -2027,7 +2027,7 @@ namespace ts {
|
|||
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) {
|
||||
|
||||
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
|
||||
if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) {
|
||||
if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) {
|
||||
return [symbolFromSymbolTable];
|
||||
}
|
||||
|
||||
|
@ -3087,8 +3087,8 @@ namespace ts {
|
|||
// Write type arguments of instantiated class/interface here
|
||||
if (flags & SymbolFormatFlags.WriteTypeParametersOrArguments) {
|
||||
if (getCheckFlags(symbol) & CheckFlags.Instantiated) {
|
||||
buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol),
|
||||
(<TransientSymbol>symbol).mapper, writer, enclosingDeclaration);
|
||||
const params = getTypeParametersOfClassOrInterface(symbol.flags & SymbolFlags.Alias ? resolveAlias(symbol) : symbol);
|
||||
buildDisplayForTypeArgumentsAndDelimiters(params, (<TransientSymbol>symbol).mapper, writer, enclosingDeclaration);
|
||||
}
|
||||
else {
|
||||
buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration);
|
||||
|
|
16
tests/cases/fourslash/quickInfoOnMethodOfImportEquals.ts
Normal file
16
tests/cases/fourslash/quickInfoOnMethodOfImportEquals.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// Test for https://github.com/Microsoft/TypeScript/issues/15931
|
||||
|
||||
// @Filename: /a.d.ts
|
||||
////declare class C<T> {
|
||||
//// m(): void;
|
||||
////}
|
||||
////export = C;
|
||||
|
||||
// @Filename: /b.ts
|
||||
////import C = require("./a");
|
||||
////declare var x: C<number>;
|
||||
////x./**/m;
|
||||
|
||||
verify.quickInfoAt("", "(method) C<number>.m(): void", undefined);
|
Loading…
Reference in a new issue