[PATCH] D46670: [clangd] Move helpers that convert Replacements to TextEdits to SourceCode.h

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 11 04:49:19 PDT 2018


ioeric added inline comments.


================
Comment at: clangd/SourceCode.h:62
+std::vector<TextEdit>
+replacementsToEdits(StringRef Code,
+                    const std::vector<tooling::Replacement> &Replacements);
----------------
ilya-biryukov wrote:
> Do we really need to expose separate functions for `vector<tooling::Replacement>` and `tooling::Replacements`, given that both are trivial: loop over the array, convert each item?
> Having them in `.cpp` file didn't hurt, but they seems redundant in the public header.
> WDYT?
Good point. Use of `std::vector<Replacement>` should be discouraged anyway. I removed this function and inline the conversion for `std::vector<Replacement>` as this is only used in rename (which should probably be fixed to use `tooling::Replacements` instead).


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46670





More information about the cfe-commits mailing list