[PATCH] D56610: [clangd] A code action to qualify an unqualified name

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 14 16:33:01 PST 2019


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





More information about the cfe-commits mailing list