Skip to content

Commit

Permalink
Workspace symbols now includes programs with main
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Allan <[email protected]>
  • Loading branch information
worksofliam committed May 5, 2023
1 parent 6c5c741 commit 1549ef6
Showing 1 changed file with 33 additions and 30 deletions.
63 changes: 33 additions & 30 deletions server/src/providers/project/workspaceSymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,44 @@ export default function workspaceSymbolProvider(params: WorkspaceSymbolParams):
)
)
)
} else if (baseNameLower.includes(`.pgm.`)) {
symbols.push(
WorkspaceSymbol.create(
basename,
SymbolKind.Method,
uri,
Range.create(
0,
0,
0,
0
)
)
)
} else {
const cache = parser.getParsedCache(uri);

if (cache) {
cache.procedures.forEach(proc => {
if (proc.keyword[`EXPORT`]) {
symbols.push(
WorkspaceSymbol.create(
proc.name,
SymbolKind.Function,
uri,
Range.create(
proc.position.line,
0,
proc.position.line,
0
)
if (cache.keyword[`MAIN`]) {
symbols.push(
WorkspaceSymbol.create(
basename,
SymbolKind.Method,
uri,
Range.create(
0,
0,
0,
0
)
);
}
});
)
);
} else
if (cache.keyword[`NOMAIN`]) {
cache.procedures.forEach(proc => {
if (proc.keyword[`EXPORT`]) {
symbols.push(
WorkspaceSymbol.create(
proc.name,
SymbolKind.Function,
uri,
Range.create(
proc.position.line,
0,
proc.position.line,
0
)
)
);
}
});
}
}
}
});
Expand Down

0 comments on commit 1549ef6

Please sign in to comment.