[PATCH] D84144: [clangd] Remove TokenBuffer usage in TypeHierarchy

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 20 04:00:16 PDT 2020


ArcsinX marked 2 inline comments as done.
ArcsinX added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp:533
+
+  Annotations HeaderInPreambleAnnotations(R"cpp(
+struct Parent {
----------------
kadircet wrote:
> this doesn't need to be an `Annotation` and sorry for missing it in the first pass but since this only has a single header, you can actually do something like:
> 
> ```
> TestTU TU = TestTU::withCode(SourceAnnotations.code());
> TU.HeaderCode = "struct Parent { int a; }";
> ```
> 
> and also drop the include directive in `SourceAnnotations` as `TU.HeaderCode` is implicitly included.
Seems now I need it to check selection range.


================
Comment at: clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp:548
+  EXPECT_THAT(*Result, AllOf(WithName("Child"),
+                             Parents(AllOf(WithName("Parent"), Parents()))));
+}
----------------
kadircet wrote:
> could you also make sure selection range is correct at least for `Parent` (as main file ranges are tested elsewhere already), so that we don't regress it in the future.
Added Parent selection range check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84144





More information about the cfe-commits mailing list