Skip to content

Why not use workspace/symbol in find_symbol (or a new LSP-only tool)? #602

@Daniel599

Description

@Daniel599

Hi,

In #44 the proposal to use workspace/symbol was closed with:

“Won’t do, we use the symbol tree to construct the name_path.”

That makes sense for correctness, but a big advantage of LSP servers is the ability to find symbols outside the current project folder, including external libraries.
I did a small patch to test it in a large cpp project with libraries as "add_subdirectory" and called "request_workspace_symbol" and it found the symbol in the external library and did it really fast, using clangd

Would you consider:
introducing a new tool/flag (e.g. find_symbol_lsp or find_symbol --lsp-only) for cases where external coverage is more valuable than strict name_path reconstruction?

Or

a hybrid approach (use workspace/symbol for candidate discovery, then validate with the symbol tree),

Or

Use just lsp without symbol tree but add support for the name_path format class/method

This way both workflows are supported without changing the existing contract.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions