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
Enhance Rust symbol search #1743
Comments
The doc says:
FFS why would do they do this? The best part is that this harebrained scheme doesn't even work in vscode:
LSP is a joke. I think you should raise this with the server vendor and say that |
yeah, because your "query" is "Foo#" and YCM matches that against all the returned results, which of course doesn't match. |
@puremourning But the docs then proceed to say
Is the capital letter in rust similar to go's private vs public? I agree that this should be a part of the protocol instead, but the requested change is tiny. I wouldn't mind reviewing that pull request. |
I tried this out and the r-a workspace symbol is just... strange:
The default behaviour seems.. OK ? I guess. if it looks like a function and doesn't match a type, it switches to functions? |
Yes it indeed toggles at some scenarios, but it is not reliable and the toggle will not trigger if it does't look like function(Yeah, I mean trait). The most annoying part is traits are filtered by default. If I have a trait called Foo, and a struct called FooBar, then if I just type Foo, I will only get FooBar not Foo. This is indeed a stupid design and really drives me crazy. |
I think I will do that. Padding a # might introduce other problems in large projects. |
Okay, I found the best way to deal with this. I can pass option to R-A to make the symbol search to return everything. No need for the # hack. Not sure if we want to include a flag to pass this config to R-A. |
We have a mechanism for changing the default behaviour of completers. So far that was only ever used to get LSP servers to cooperate. |
Then I guess the best way might be to have a side note about this in the documentation. In case people like me want to perform global symbol search. |
This is more of a rust-analyzer problem but I think we can introduce an adaptation as it is pretty simple to do.
In rust-analyzer, the default workspace symbol has a behavior that some of the results are filtered out by default unless you put a # after it. Here is the reference (The docs is a bit confusing, but the take away is that if you want to find all symbols you have to append a #, because function includes type). And the trait information is filtered out by default which is quite annoying.
While it is okay for me to just add a # when I am performing
GoToSymbol
likeGoToSymbol Foo#
, for the interactive interface I will have to turn off g:ycm_refilter_workspace_symbols as I think the default sorting algorithm does not add new items but only filters out old ones (correct me if I am wrong). Even with these workaround, typing a # in the end is just too tedious. Therefore I am wondering if it is acceptable to introduce a flag for rust completer, which add a # to the end of the query when switched on. I can take care of the PR if it is ok.Something like this (My current approach)
Thank you for creating such a wonderful tool.
The text was updated successfully, but these errors were encountered: