mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Completion entry details of union of methods with no call signature
Fixes #928
This commit is contained in:
@@ -2764,7 +2764,8 @@ module ts {
|
||||
|
||||
if (flags & SymbolFlags.Property) {
|
||||
if (flags & SymbolFlags.UnionProperty) {
|
||||
return forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
|
||||
// If any of the property includes the declaration of property - the kind is property
|
||||
var unionPropetyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
|
||||
var rootSymbolFlags = rootSymbol.getFlags();
|
||||
if (rootSymbolFlags & SymbolFlags.Property) {
|
||||
return ScriptElementKind.memberVariableElement;
|
||||
@@ -2772,7 +2773,16 @@ module ts {
|
||||
if (rootSymbolFlags & SymbolFlags.GetAccessor) return ScriptElementKind.memberVariableElement;
|
||||
if (rootSymbolFlags & SymbolFlags.SetAccessor) return ScriptElementKind.memberVariableElement;
|
||||
Debug.assert((rootSymbolFlags & SymbolFlags.Method) !== undefined);
|
||||
}) || ScriptElementKind.memberFunctionElement;
|
||||
});
|
||||
if (!unionPropetyKind) {
|
||||
// If this was union of all methods, make sure it has call signatures before we call it method
|
||||
var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbol(symbol);
|
||||
if (typeOfUnionProperty.getCallSignatures().length) {
|
||||
return ScriptElementKind.memberFunctionElement;
|
||||
}
|
||||
return ScriptElementKind.memberVariableElement;
|
||||
}
|
||||
return unionPropetyKind;
|
||||
}
|
||||
return ScriptElementKind.memberVariableElement;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user