[PATCH] D44673: Make positionToOffset return llvm::Expected<size_t>

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 21 04:44:33 PDT 2018


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM. See the empty line NITS, though.



================
Comment at: clangd/ClangdServer.cpp:199
+    return End.takeError();
+
+  return formatCode(Code, File, {tooling::Range(*Begin, *End - *Begin)});
----------------
NIT: unnecessary empty line


================
Comment at: clangd/ClangdServer.cpp:216
+    return CursorPos.takeError();
+
+  size_t PreviousLBracePos = StringRef(Code).find_last_of('{', *CursorPos);
----------------
NIT: unnecessary empty line




================
Comment at: clangd/SourceCode.cpp:29
+        llvm::errc::invalid_argument);
+
   size_t StartOfLine = 0;
----------------
NIT: unnecessary empty line




================
Comment at: clangd/SourceCode.cpp:48
+        llvm::errc::invalid_argument);
+
   // FIXME: officially P.character counts UTF-16 code units, not UTF-8 bytes!
----------------
NIT: unnecessary empty line




================
Comment at: unittests/clangd/Annotations.cpp:91
+  llvm::Expected<size_t> End = positionToOffset(Code, R.end);
+
+  assert(Start);
----------------
NIT: unnecessary empty line




================
Comment at: unittests/clangd/Annotations.cpp:94
+  assert(End);
+
+  return {*Start, *End};
----------------
NIT: unnecessary empty line




Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44673





More information about the cfe-commits mailing list