[PATCH] D42164: [clangd] Don't crash on LSP calls for non-added files

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 04:19:17 PST 2018

sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.

Comment at: clangd/ClangdLSPServer.cpp:153
+  auto Code = Server.getDocument(File);
+  if (!Code)
don't you want to do this before computing replacements?

Comment at: clangd/ClangdLSPServer.cpp:155
+  if (!Code)
+    return replyError(C, ErrorCode::InternalError,
+                      "onRename called for non-added file");

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list