( name: string, kind: DisplayInfoKind, containerName: string | undefined, type: string | undefined, )
| 102 | * @param documentation docstring or comment |
| 103 | */ |
| 104 | export 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 |
no outgoing calls
no test coverage detected