Skip to content

Commit 2effa52

Browse files
committed
Simplify getGlobalDeclarations
1 parent 5bb71d4 commit 2effa52

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

server/src/util/declarations.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ export function getGlobalDeclarations({
3737
const diagnostics: LSP.Diagnostic[] = []
3838
const globalDeclarations: GlobalDeclarations = {}
3939

40-
TreeSitterUtil.forEach(tree.rootNode, (node: Parser.SyntaxNode) => {
41-
if (node.parent?.type !== 'program') {
42-
return
43-
}
44-
40+
tree.rootNode.children.forEach((node) => {
4541
if (node.type === 'ERROR') {
4642
diagnostics.push(
4743
LSP.Diagnostic.create(
@@ -61,8 +57,6 @@ export function getGlobalDeclarations({
6157
globalDeclarations[word] = symbol
6258
}
6359
}
64-
65-
return
6660
})
6761

6862
return { diagnostics, globalDeclarations }

0 commit comments

Comments
 (0)