( symbol: DocumentSymbol, depth = 0, containerName?: string, )
| 127 | } |
| 128 | |
| 129 | function processDocumentSymbol( |
| 130 | symbol: DocumentSymbol, |
| 131 | depth = 0, |
| 132 | containerName?: string, |
| 133 | ): ProcessedSymbol { |
| 134 | const processed: ProcessedSymbol = { |
| 135 | name: symbol.name, |
| 136 | kind: symbol.kind, |
| 137 | kindName: getSymbolKindName(symbol.kind), |
| 138 | detail: symbol.detail, |
| 139 | range: { |
| 140 | startLine: symbol.range.start.line, |
| 141 | startCharacter: symbol.range.start.character, |
| 142 | endLine: symbol.range.end.line, |
| 143 | endCharacter: symbol.range.end.character, |
| 144 | }, |
| 145 | selectionRange: { |
| 146 | startLine: symbol.selectionRange.start.line, |
| 147 | startCharacter: symbol.selectionRange.start.character, |
| 148 | endLine: symbol.selectionRange.end.line, |
| 149 | endCharacter: symbol.selectionRange.end.character, |
| 150 | }, |
| 151 | depth, |
| 152 | containerName, |
| 153 | }; |
| 154 | |
| 155 | if (symbol.children && symbol.children.length > 0) { |
| 156 | processed.children = symbol.children.map((child) => |
| 157 | processDocumentSymbol(child, depth + 1, symbol.name), |
| 158 | ); |
| 159 | } |
| 160 | |
| 161 | return processed; |
| 162 | } |
| 163 | |
| 164 | function processSymbolInformation( |
| 165 | symbol: SymbolInformation, |
no test coverage detected