We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
findNodesOfType
walkTreeFlatMapping
1 parent db5452c commit c398fc9Copy full SHA for c398fc9
server/src/server.ts
@@ -1206,13 +1206,9 @@ export function getDocumentSymbols(document: TextDocument): DocumentSymbol[] {
1206
}
1207
1208
function findNodesOfType(rootNode: SyntaxNode, type: string): SyntaxNode[] {
1209
- const nodes: SyntaxNode[] = [];
1210
- walkTree(rootNode, (node) => {
1211
- if (node.type === type) {
1212
- nodes.push(node);
1213
- }
+ return walkTreeFlatMapping(rootNode, (node) => {
+ return (node.type === type) ? [node] : [];
1214
});
1215
- return nodes;
1216
1217
1218
function findWhereClauseDeclarations(rootNode: SyntaxNode): SyntaxNode[] {
0 commit comments