LSP is not great for non-editor use cases. Everything is cursor position oriented.
Yes, something like TreeSitter would seem to be of more value - able to lookup symbols by name, and find the spans of source code where they are defined and used.
There are actions that don't require cursor position, like document/workspace symbols, that could be useful.
Yes, something like TreeSitter would seem to be of more value - able to lookup symbols by name, and find the spans of source code where they are defined and used.