Skip to content

Commit acc1dfd

Browse files
committed
Slightly improve breadcrumb performance
1 parent c134ebc commit acc1dfd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

out/DocumentSymbolProvider.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ const DocumentSymbolProvider = {
2424
for (let index = 0; index < node.namedChildCount; index++)
2525
this.getAllChildren(node.namedChild(index), symbolsChildren)
2626
else
27-
for (let index = 0; index < node.childCount; index++)
28-
this.getAllChildren(node.child(index), symbolsChildren)
27+
for (const childNode of node.namedChildren)
28+
this.getAllChildren(childNode, symbolsChildren)
29+
// for (let index = 0; index < node.childCount; index++)
30+
// this.getAllChildren(node.child(index), symbolsChildren)
2931

3032

3133
const range = extension.nodeToVscodeRange(node)
3234
const documentSymbol = new vscode.DocumentSymbol(
3335
node.type,
34-
node.text,
36+
node.text.substring(0, 100),
3537
node.isNamed() ? vscode.SymbolKind.Function : vscode.SymbolKind.Field,
3638
range,
3739
range

0 commit comments

Comments
 (0)