[PATCH] D61497: [clangd] Introduce a structured hover response

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 07:10:17 PDT 2019


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:940
           )cpp",
-          "class std::initializer_list<int>",
+          "template<> class initializer_list<int> {}",
       },
----------------
kadircet wrote:
> sammccall wrote:
> > hmm, this is a bit weird - this uses specialization syntax but there's no actual specialization here right?
> > I think the old output without `template<>` is probably better if possible.
> The old behavior was inconsistent in the case of auto. We print the decl in all cases, but print the type in the case of auto. For example, if you had 
> `initializer_list<int> i = {1,2}` instead of `auto i = {1,2}` you would get the new response I've provided in this test.
> 
> I agree this looks weird in the case of instantiations but I believe it is more important to give a consistent look.
as discussed offline, leaving this as it is in the initial version and adding tests with both auto and non-auto cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61497/new/

https://reviews.llvm.org/D61497





More information about the cfe-commits mailing list