From a4c14a2cdc67a329251d4d47b058a6b371ee66f5 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 4 Jun 2020 02:00:28 -0400 Subject: [PATCH] `getSymbolDisplayPartsDocumentationAndSymbolKind`: use actual `symbol.flags` for `getAliasedSymbol` Fixes #35347. --- src/services/symbolDisplay.ts | 3 ++- tests/cases/fourslash/quickInfoJSExport.ts | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/quickInfoJSExport.ts diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index e6891bc12259d..d62be2649031a 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -379,7 +379,8 @@ namespace ts.SymbolDisplay { } } } - if (symbolFlags & SymbolFlags.Alias) { + // don't use symbolFlags since getAliasedSymbol requires the flag on the symbol itself + if (symbol.flags & SymbolFlags.Alias) { prefixNextMeaning(); if (!hasAddedSymbolInfo) { const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); diff --git a/tests/cases/fourslash/quickInfoJSExport.ts b/tests/cases/fourslash/quickInfoJSExport.ts new file mode 100644 index 0000000000000..24a9bd00fa30b --- /dev/null +++ b/tests/cases/fourslash/quickInfoJSExport.ts @@ -0,0 +1,24 @@ +/// + +// GH #35347 + +// @Filename: a.js +// @allowJs: true +//// /** +//// * @enum {string} +//// */ +//// const testString = { +//// one: "1", +//// two: "2" +//// }; +//// +//// export { test/**/String }; + +verify.quickInfoAt("", +`type testString = string +(alias) type testString = any +(alias) const testString: { + one: string; + two: string; +} +export testString`);