diff --git a/packages/api/src/localizedTree.ts b/packages/api/src/localizedTree.ts index eee7837..7e5474d 100644 --- a/packages/api/src/localizedTree.ts +++ b/packages/api/src/localizedTree.ts @@ -69,7 +69,7 @@ type TypeInfoChildren = ({ info?: TypeInfo, localizedInfo?: LocalizedTypeInfo, o export type LocalizedTypeInfo = { kindText?: string, - kind?: ResolvedTypeInfo['kind'], + kind?: ResolvedTypeInfo['kind']|'signature'|'index_info', primitiveKind?: TypeInfoKind<'primitive'>['primitive'], alias?: string, symbol?: LocalizedSymbolInfo, @@ -324,6 +324,7 @@ function getChildren(info: ResolvedTypeInfo, { typeArguments: contextualTypeArgu function getLocalizedIndex(indexInfo: IndexInfo) { return createChild({ kindText: "index", + kind: "index_info", symbol: wrapSafe(localizeSymbol)(indexInfo.parameterSymbol), children: [ ...indexInfo.keyType ? [localizeOpts(indexInfo.keyType, { purpose: 'index_type'})] : [], @@ -337,6 +338,7 @@ function getChildren(info: ResolvedTypeInfo, { typeArguments: contextualTypeArgu return createChild({ kindText: "signature", + kind: "signature", symbol, locations: symbol?.locations, children: getLocalizedSignatureChildren(signature, typeArguments), }) diff --git a/packages/typescript-explorer/src/view/typeTreeView.ts b/packages/typescript-explorer/src/view/typeTreeView.ts index 6673073..890bab5 100644 --- a/packages/typescript-explorer/src/view/typeTreeView.ts +++ b/packages/typescript-explorer/src/view/typeTreeView.ts @@ -285,6 +285,7 @@ function getMeta(info: LocalizedTypeInfo): TypeTreeItemMeta { return ["symbol-struct"] } + case "signature": case "function": { if(info.symbol?.insideClassOrInterface) { return ["symbol-method"] @@ -301,6 +302,7 @@ function getMeta(info: LocalizedTypeInfo): TypeTreeItemMeta { return ["symbol-class"] } + case "index_info": case "indexed_access": case "index": { return ["key", "symbolIcon.keyForeground"]