malaperle added inline comments.

================
Comment at: clangd/ClangdUnit.cpp:1245
+
+  for (unsigned I = 0; I < DocHighlightsFinder->getSourceRanges().size(); I++) 
{
+    HighlightLocations.push_back(
----------------
malaperle wrote:
> replace all this code (1242-1265) by moving it in DocumentHighlightsFinder? 
> then call takeHighlights.
Also, use a range-based for loop


================
Comment at: clangd/ClangdUnit.cpp:1247
+    HighlightLocations.push_back(
+        addHighlightLocation(AST, DocHighlightsFinder->getSourceRanges()[I],
+                             DocHighlightsFinder->getKinds()[I]));
----------------
The vector returned by getKinds() doesn't match the size of getSourceRanges(). 
This is because the kinds vector is computed in DeclarationLocationsFinder 
which only computes the kind of the occurrence the user has selected, not the 
kinds of all occurrences for a given Decl. Once you move the code to create the 
highlights in DocumentHighlightsFinder, you won't need a vector of kinds and 
this won't be a problem.


https://reviews.llvm.org/D38425



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

Reply via email to