[PATCH] D38639: [clangd] #include statements support for Open definition
Marc-Andre Laperle via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 12 19:10:50 PST 2018
malaperle added inline comments.
================
Comment at: clangd/ClangdUnit.h:51
+using IncludeReferenceMap = std::unordered_map<Range, Path, RangeHash>;
+
----------------
ilya-biryukov wrote:
> We use `unordered_map` as a `vector<pair<>>` here. (i.e. we never look up values by key, because we don't only the range, merely a point in the range)
> Replace map with `vector<pair<>>` and remove `RangeHash` that we don't need anymore.
Done. I also renamed, IncludeReferenceMap to InclusionLocations. I thought I was more suitable.
================
Comment at: unittests/clangd/ClangdTests.cpp:781
+
+ Position P = Position{1, 11};
+
----------------
ilya-biryukov wrote:
> We moved `findDefinition` tests to `XRefsTests.cpp` and added a useful `Annotation` helper to make writing these tests simpler.
> Maybe we could use it for this test as well?
Done. (I don't know why I can't use the "done" checkbox, maybe because I wasn't the original author?)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D38639
More information about the cfe-commits
mailing list