[PATCH] D88567: [clangd] Fix invalid UTF8 when extracting doc comments.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 30 07:04:39 PDT 2020


sammccall added a comment.

In D88567#2303332 <https://reviews.llvm.org/D88567#2303332>, @kadircet wrote:

> thanks, LGTM!
>
> Should we also have another test for SymbolCollector, to ensure we don't regress this somehow in the future?

We had a SymbolCollector test for the boost case so I modified it to add a doc comment.



================
Comment at: clang-tools-extra/clangd/CodeCompletionStrings.cpp:93
+  // Clang requires source to be UTF-8, but doesn't enforce this in comments.
+  if (!llvm::json::isUTF8(Doc))
+    Doc = llvm::json::fixUTF8(Doc);
----------------
kadircet wrote:
> it is always surprising to have these helpers in json library :D (just talking out loud)
Yeah. They're just wrappers around functions from `ConvertUTF.h`.
Do you want a patch to move them there?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88567



More information about the cfe-commits mailing list