Properly display optional methods in language service
This commit is contained in:
parent
b90761cf43
commit
20e2be2d51
1 changed files with 2 additions and 0 deletions
|
@ -4541,8 +4541,10 @@ namespace ts {
|
|||
}
|
||||
|
||||
// For properties, variables and local vars: show the type
|
||||
// Also handle methods that have a union type (i.e. that may be undefined)
|
||||
if (symbolKind === ScriptElementKind.memberVariableElement ||
|
||||
symbolFlags & SymbolFlags.Variable ||
|
||||
symbolFlags & SymbolFlags.Method && type.flags & TypeFlags.Union ||
|
||||
symbolKind === ScriptElementKind.localVariableElement ||
|
||||
isThisExpression) {
|
||||
displayParts.push(punctuationPart(SyntaxKind.ColonToken));
|
||||
|
|
Loading…
Reference in a new issue