Skip to content

Commit b43c123

Browse files
More quick info work.
1 parent 4d1a43a commit b43c123

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module ts {
8484
getTypeOfNode: getTypeOfNode,
8585
getApparentType: getApparentType,
8686
typeToString: typeToString,
87-
typeToDisplayParts: undefined,
87+
typeToDisplayParts: typeToDisplayParts,
8888
symbolToString: symbolToString,
8989
symbolToDisplayParts: symbolToDisplayParts,
9090
getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType,

src/services/services.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ module ts {
665665
kind: this.kind,
666666
kindModifiers: this.kindModifiers,
667667
textSpan: this.textSpan,
668-
displayParts: this.displayParts.forEach(d => {
668+
displayParts: this.displayParts.map(d => {
669669
return {
670670
text: d.text,
671671
kind: SymbolDisplayPartKind[d.kind]
@@ -2255,11 +2255,33 @@ module ts {
22552255
return undefined;
22562256
}
22572257

2258+
var totalParts: SymbolDisplayPart[] = [];
2259+
if (symbol.flags & SymbolFlags.Class) {
2260+
totalParts.push({ text: "class", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
2261+
}
2262+
else if (symbol.flags & SymbolFlags.Interface) {
2263+
totalParts.push({ text: "interface", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
2264+
}
2265+
else if (symbol.flags & SymbolFlags.Enum) {
2266+
totalParts.push({ text: "enum", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
2267+
}
2268+
else if (symbol.flags & SymbolFlags.Module) {
2269+
totalParts.push({ text: "module", kind: SymbolDisplayPartKind.keyword, symbol: undefined });
2270+
}
2271+
2272+
totalParts.push({ text: " ", kind: SymbolDisplayPartKind.space, symbol: undefined });
2273+
totalParts.push.apply(totalParts, typeInfoResolver.symbolToDisplayParts(symbol, getContainerNode(node)));
2274+
2275+
var type = typeInfoResolver.getTypeOfSymbol(symbol);
2276+
if (type) {
2277+
totalParts.push.apply(totalParts, typeInfoResolver.typeToDisplayParts(type));
2278+
}
2279+
22582280
return new QuickInfo(
22592281
getSymbolKind(symbol),
22602282
getSymbolModifiers(symbol),
22612283
new TypeScript.TextSpan(node.getStart(), node.getWidth()),
2262-
typeInfoResolver.symbolToDisplayParts(symbol));
2284+
totalParts);
22632285
}
22642286

22652287
function getTypeAtPosition(fileName: string, position: number): TypeInfo {

0 commit comments

Comments
 (0)