sammccall added inline comments.

================
Comment at: clangd/CodeComplete.cpp:270
+  /// namespace scopes which are visible to the qualified-id completion token.
+  std::vector<std::string> Scopes;
+};
----------------
ilya-biryukov wrote:
> sammccall wrote:
> > Just to check, if the user types:
> > "vec" --> None
> > "::vec" --> {""}
> > "std::vec" --> {"std"}
> > "using namespace std; vec" --> None
> > "using namespace std; ::vec" --> {"", "std"}
> > 
> > is this right?
> I think the idea was to have (I only highlight the differences):
> "vec" --> {""}
> "using namespace std; vec" --> {"", "std"}
> 
> @hokein , or am I getting it wrong?
You're probably right, just want to be sure we're talking about the same thing.

There's two layers here: the context detected from sema, and what we're going 
to send the index. The layering is more relevant now that more of this moves 
out of clangd.

for "vec", we should be sending {""} to the index for now, and later move 
towards doing global completion.
But if possible the detection code should report None, and the query-index code 
should translate it - there's no reason the detection code needs to be wrong 
just because clangd can't do qualifier insertion/smart ranking/etc.

That said, per our discussion this morning, the detected state shouldn't really 
be Optional<vector<string>>, but rather struct { vector<string> 
AccessibleScope, optional<string> UnresolvedQualifier } or something like 
that...


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42073



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to