@@ -254,18 +254,15 @@ export interface SymbolDisplayPartsDocumentationAndSymbolKind {
254
254
tags : JSDocTagInfo [ ] | undefined ;
255
255
}
256
256
257
- // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
258
- /** @internal */
259
- export function getSymbolDisplayPartsDocumentationAndSymbolKind ( typeChecker : TypeChecker , symbol : Symbol , sourceFile : SourceFile , enclosingDeclaration : Node | undefined ,
260
- location : Node , semanticMeaning = getMeaningFromLocation ( location ) , alias ?: Symbol ) : SymbolDisplayPartsDocumentationAndSymbolKind {
257
+ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker ( typeChecker : TypeChecker , symbol : Symbol , sourceFile : SourceFile , enclosingDeclaration : Node | undefined ,
258
+ location : Node , type : Type | undefined , semanticMeaning : SemanticMeaning , alias ?: Symbol ) : SymbolDisplayPartsDocumentationAndSymbolKind {
261
259
const displayParts : SymbolDisplayPart [ ] = [ ] ;
262
260
let documentation : SymbolDisplayPart [ ] = [ ] ;
263
261
let tags : JSDocTagInfo [ ] = [ ] ;
264
262
const symbolFlags = getCombinedLocalAndExportSymbolFlags ( symbol ) ;
265
263
let symbolKind = semanticMeaning & SemanticMeaning . Value ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar ( typeChecker , symbol , location ) : ScriptElementKind . unknown ;
266
264
let hasAddedSymbolInfo = false ;
267
265
const isThisExpression = location . kind === SyntaxKind . ThisKeyword && isInExpressionContext ( location ) || isThisInTypeQuery ( location ) ;
268
- let type : Type | undefined ;
269
266
let documentationFromAlias : SymbolDisplayPart [ ] | undefined ;
270
267
let tagsFromAlias : JSDocTagInfo [ ] | undefined ;
271
268
let hasMultipleSignatures = false ;
@@ -300,7 +297,7 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
300
297
}
301
298
302
299
let signature : Signature | undefined ;
303
- type = isThisExpression ? typeChecker . getTypeAtLocation ( location ) : typeChecker . getTypeOfSymbolAtLocation ( symbol , location ) ;
300
+ type ?? = isThisExpression ? typeChecker . getTypeAtLocation ( location ) : typeChecker . getTypeOfSymbolAtLocation ( symbol , location ) ;
304
301
305
302
if ( location . parent && location . parent . kind === SyntaxKind . PropertyAccessExpression ) {
306
303
const right = ( location . parent as PropertyAccessExpression ) . name ;
@@ -553,12 +550,13 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
553
550
isModuleWithStringLiteralName ( resolvedNode ) &&
554
551
hasSyntacticModifier ( resolvedNode , ModifierFlags . Ambient ) ;
555
552
const shouldUseAliasName = symbol . name !== "default" && ! isExternalModuleDeclaration ;
556
- const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind (
553
+ const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker (
557
554
typeChecker ,
558
555
resolvedSymbol ,
559
556
getSourceFileOfNode ( resolvedNode ) ,
560
557
resolvedNode ,
561
558
declarationName ,
559
+ type ,
562
560
semanticMeaning ,
563
561
shouldUseAliasName ? symbol : resolvedSymbol ) ;
564
562
displayParts . push ( ...resolvedInfo . displayParts ) ;
@@ -858,6 +856,13 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: Typ
858
856
}
859
857
}
860
858
859
+ // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
860
+ /** @internal */
861
+ export function getSymbolDisplayPartsDocumentationAndSymbolKind ( typeChecker : TypeChecker , symbol : Symbol , sourceFile : SourceFile , enclosingDeclaration : Node | undefined ,
862
+ location : Node , semanticMeaning = getMeaningFromLocation ( location ) , alias ?: Symbol ) : SymbolDisplayPartsDocumentationAndSymbolKind {
863
+ return getSymbolDisplayPartsDocumentationAndSymbolKindWorker ( typeChecker , symbol , sourceFile , enclosingDeclaration , location , /*type*/ undefined , semanticMeaning , alias ) ;
864
+ }
865
+
861
866
function isLocalVariableOrFunction ( symbol : Symbol ) {
862
867
if ( symbol . parent ) {
863
868
return false ; // This is exported symbol
0 commit comments