[PATCH] D44954: [clangd] Add "member" symbols to the index

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 18 02:23:38 PDT 2018


ilya-biryukov added a comment.

In https://reviews.llvm.org/D44954#1103664, @malaperle wrote:

> It's probably better to consider this in a future patch. Maybe something like the first suggestion: vector::push_back and match both. Otherwise, I would think it might be a bit too verbose to have to spell out all of the specialization. Maybe we could allow it too. So... all of the above? :)


This certainly does not have to be addressed in this patch. Just wanted to collect opinions on what the behavior we want in the long term.
My thoughts would be towards allowing only `vector::push_back` and make it match both `push_back`s: in `vector<bool>` and `vector<T>`.
Other cases might work too, but I wouldn't try implementing something that matches specializations. It's just too complicated in the general case. This will only be used in workspaceSymbol and it's fine to give a few more results there...

>> What scopes will non-scoped enum members have?
> 
> Hmm. I think all of them, since you can refer them like that in code too. Case #1 doesn't work but that was the case before this patch so it can probably be addressed separately. I'll add some tests though!

I would vote for making queries `En::A` and `A` match the enumerator, but **not** `::A`. The reasoning is: yes, you can reference it this way in a C++ file, but `workspaceSymbol` is not a real C++ resolve and I think it should match the outline of the code rather than the actual C++ lookup rules.
E.g. I wouldn't expect it to match symbols from base classes, etc. This should also simplify implementation too.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44954





More information about the cfe-commits mailing list