MCPcopy Create free account
hub / github.com/angular/angular / createDisplayParts

Function createDisplayParts

packages/language-service/src/utils/display_parts.ts:104–135  ·  view source on GitHub ↗
(
  name: string,
  kind: DisplayInfoKind,
  containerName: string | undefined,
  type: string | undefined,
)

Source from the content-addressed store, hash-verified

102 * @param documentation docstring or comment
103 */
104export function createDisplayParts(
105 name: string,
106 kind: DisplayInfoKind,
107 containerName: string | undefined,
108 type: string | undefined,
109): ts.SymbolDisplayPart[] {
110 const containerDisplayParts =
111 containerName !== undefined
112 ? [
113 {text: containerName, kind: SYMBOL_INTERFACE},
114 {text: '.', kind: SYMBOL_PUNC},
115 ]
116 : [];
117
118 const typeDisplayParts =
119 type !== undefined
120 ? [
121 {text: ':', kind: SYMBOL_PUNC},
122 {text: ' ', kind: SYMBOL_SPACE},
123 {text: type, kind: SYMBOL_INTERFACE},
124 ]
125 : [];
126 return [
127 {text: '(', kind: SYMBOL_PUNC},
128 {text: kind, kind: SYMBOL_TEXT},
129 {text: ')', kind: SYMBOL_PUNC},
130 {text: ' ', kind: SYMBOL_SPACE},
131 ...containerDisplayParts,
132 {text: name, kind: SYMBOL_INTERFACE},
133 ...typeDisplayParts,
134 ];
135}
136
137/**
138 * Convert a `SymbolDisplayInfoKind` to a `ts.ScriptElementKind` type, allowing it to pass through

Callers 4

createQuickInfoFunction · 0.90
getSymbolDisplayInfoFunction · 0.85
getDirectiveDisplayInfoFunction · 0.85
getTsSymbolDisplayInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected