[PATCH] D107365: clangd: Make documentation property of completion items more similar

Christian Kandeler via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 3 09:01:04 PDT 2021


ckandeler created this revision.
ckandeler added a reviewer: sammccall.
Herald added subscribers: usaxena95, kadircet, arphaman.
ckandeler requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

... to the one of signature hints.
In particular, completion items now also carry annotations, which client
code might be interested in.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107365

Files:
  clang-tools-extra/clangd/CodeComplete.cpp


Index: clang-tools-extra/clangd/CodeComplete.cpp
===================================================================
--- clang-tools-extra/clangd/CodeComplete.cpp
+++ clang-tools-extra/clangd/CodeComplete.cpp
@@ -405,8 +405,9 @@
       if (C.IndexResult) {
         SetDoc(C.IndexResult->Documentation);
       } else if (C.SemaResult) {
-        SetDoc(getDocComment(*ASTCtx, *C.SemaResult,
-                             /*CommentsFromHeader=*/false));
+        const auto docComment = getDocComment(*ASTCtx, *C.SemaResult,
+                                              /*CommentsFromHeader=*/false);
+        SetDoc(formatDocumentation(*SemaCCS, docComment));
       }
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107365.363762.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210803/b3186418/attachment.bin>


More information about the cfe-commits mailing list