Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support partially qualified names in workspace/symbol #550

Closed
HighCommander4 opened this issue Oct 4, 2020 · 2 comments
Closed

Support partially qualified names in workspace/symbol #550

HighCommander4 opened this issue Oct 4, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@HighCommander4
Copy link

HighCommander4 commented Oct 4, 2020

I originally filed this as clangd/vscode-clangd#31 (it was transferred into the vscode-clangd repo after filing). That ticket has been closed, but the issue is only partially fixed.

Specifically, in that ticket, a vscode-specific issue that led to workspace/symbol queries with a fully qualified name as a search string not returning results, was fixed.

There is a remaining issue on the server side, that workspace/symbol queries with partially qualified names do not return results. For example, searching for Class::Method should match ns::Class::Method or ns1::ns2::Class::Method if such entities exist.

@HighCommander4 HighCommander4 added the enhancement New feature or request label Oct 4, 2020
@kadircet
Copy link
Member

kadircet commented Oct 5, 2020

That definitely makes sense to me, send out https://reviews.llvm.org/D88814. This might degrade the search performance for top-level but not fully-qualified searches. e.g. clang:: vs ::clang. But I think providing results for sub-scopes like clangd:: is definitely worth it.

I wonder what will others think tho. Hence did not assign anyone for review yet :D

@kadircet
Copy link
Member

kadircet commented Oct 5, 2020

To summarize an offline discussion and give a bit more details:

  • An unqualified lookup (e.g. Foo) or a fully-qualified lookup (e.g. ::Foo) isn't going to be affected by this change.
  • Qualified lookups of the form foo::bar::Baz are going to be a lookup in all scopes, with symbols from ::foo::bar being boosted and any results that doesn't have foo::bar:: as a "sub-scope" will be filtered.

arichardson pushed a commit to arichardson/llvm-project that referenced this issue Mar 24, 2021
This will enable queries like "clangd::" to find symbols under clangd
namespace, without requiring full "clang::clangd::" qualification.

Since Fuzzyfind performs the search under all scopes and only boosts the symbols
from relevant namespaces, we might get symbols from non-matching namespaces.
This patch chooses to drop those as they clearly do not match the query.

Fixes clangd/clangd#550.

Differential Revision: https://reviews.llvm.org/D88814
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
This will enable queries like "clangd::" to find symbols under clangd
namespace, without requiring full "clang::clangd::" qualification.

Since Fuzzyfind performs the search under all scopes and only boosts the symbols
from relevant namespaces, we might get symbols from non-matching namespaces.
This patch chooses to drop those as they clearly do not match the query.

Fixes clangd/clangd#550.

Differential Revision: https://reviews.llvm.org/D88814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants