mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Tweak the appearance to match the old managed LS behavior.
This commit is contained in:
parent
b43c123b53
commit
82160d1a88
@ -2255,26 +2255,63 @@ module ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Having all this logic here is pretty unclean. Consider moving to the roslyn model
|
||||
// where all symbol display logic is encapsulated into visitors and options.
|
||||
var totalParts: SymbolDisplayPart[] = [];
|
||||
var addType = false;
|
||||
|
||||
if (symbol.flags & SymbolFlags.Class) {
|
||||
totalParts.push({ text: "class", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
|
||||
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.Interface) {
|
||||
totalParts.push({ text: "interface", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
|
||||
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.Enum) {
|
||||
totalParts.push({ text: "enum", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
|
||||
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.Module) {
|
||||
totalParts.push({ text: "module", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
|
||||
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.TypeParameter) {
|
||||
}
|
||||
else {
|
||||
addType = true;
|
||||
totalParts.push({ text: "(", kind: SymbolDisplayPartKind.punctuation, symbol: undefined });
|
||||
var text: string;
|
||||
|
||||
if (symbol.flags & SymbolFlags.Property) { text = "property" }
|
||||
else if (symbol.flags & SymbolFlags.EnumMember) { text = "enum member" }
|
||||
else if (symbol.flags & SymbolFlags.Function) { text = "function" }
|
||||
else if (symbol.flags & SymbolFlags.Variable) { text = "variable" }
|
||||
else if (symbol.flags & SymbolFlags.Method) { text = "method" }
|
||||
|
||||
if (!text) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
totalParts.push({ text: text, kind: SymbolDisplayPartKind.text, symbol: undefined });
|
||||
totalParts.push({ text: ")", kind: SymbolDisplayPartKind.punctuation, symbol: undefined });
|
||||
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
|
||||
}
|
||||
|
||||
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
|
||||
totalParts.push.apply(totalParts, typeInfoResolver.symbolToDisplayParts(symbol, getContainerNode(node)));
|
||||
|
||||
var type = typeInfoResolver.getTypeOfSymbol(symbol);
|
||||
if (type) {
|
||||
totalParts.push.apply(totalParts, typeInfoResolver.typeToDisplayParts(type));
|
||||
if (symbol.flags & SymbolFlags.Property ||
|
||||
symbol.flags & SymbolFlags.EnumMember ||
|
||||
symbol.flags & SymbolFlags.Variable) {
|
||||
|
||||
totalParts.push({ text: ".", kind: SymbolDisplayPartKind.punctuation, symbol: undefined });
|
||||
}
|
||||
|
||||
if (addType) {
|
||||
var type = typeInfoResolver.getTypeOfSymbol(symbol);
|
||||
if (type) {
|
||||
totalParts.push.apply(totalParts, typeInfoResolver.typeToDisplayParts(type));
|
||||
}
|
||||
}
|
||||
|
||||
return new QuickInfo(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user