jkorous added a comment.

Hi Ilya, I got here from reading your other patch 
(https://reviews.llvm.org/D56611). I'm wondering if we could make those range 
utility functions more understandable.



================
Comment at: clangd/SourceCode.h:64
 
+/// Turns a token range into a half-open range and checks its correctness.
+/// The resulting range will have only valid source location on both sides, 
both
----------------
It seems to me the range is actually closed on both sides.
Do I get it right that the result is?

```
[begin of first token : end of last token]
```

Wouldn't some name like `toWholeTokenRange` be easier to understand?


================
Comment at: clangd/SourceCode.h:81
+/// Preconditions: isValidFileRange(R) == true, L is a file location.
+bool halfOpenRangeContains(const SourceManager &Mgr, SourceRange R,
+                           SourceLocation L);
----------------
I'd find it helpful to mention that the range is actually interpreted as 
closed-open (knowing which half is which).


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D56610



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

Reply via email to