MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / processDocumentSymbol

Function processDocumentSymbol

src/cm/lsp/documentSymbols.ts:129–162  ·  view source on GitHub ↗
(
	symbol: DocumentSymbol,
	depth = 0,
	containerName?: string,
)

Source from the content-addressed store, hash-verified

127}
128
129function 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
164function processSymbolInformation(
165 symbol: SymbolInformation,

Callers 1

fetchDocumentSymbolsFunction · 0.85

Calls 1

getSymbolKindNameFunction · 0.85

Tested by

no test coverage detected