]> granicus.if.org Git - clang/commit
[AST] Added a helper to extract a user-friendly text of a comment.
authorIlya Biryukov <ibiryukov@google.com>
Wed, 16 May 2018 12:30:09 +0000 (12:30 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 16 May 2018 12:30:09 +0000 (12:30 +0000)
commitbfc7cfab82c332ec0070bf8cfb2c24359bef640d
tree00280f2b6232b877cd3ac843373a21f4080c2ef9
parent983ac4e991973db70b0e0ef336baa525f293ed99
[AST] Added a helper to extract a user-friendly text of a comment.

Summary:
The helper is used in clangd for documentation shown in code completion
and storing the docs in the symbols. See D45999.

This patch reuses the code of the Doxygen comment lexer, disabling the
bits that do command and html tag parsing.
The new helper works on all comments, including non-doxygen comments.
However, it does not understand or transform any doxygen directives,
i.e. cannot extract brief text, etc.

Reviewers: sammccall, hokein, ioeric

Reviewed By: ioeric

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D46000

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332458 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/CommentLexer.h
include/clang/AST/RawCommentList.h
lib/AST/CommentLexer.cpp
lib/AST/RawCommentList.cpp
unittests/AST/CMakeLists.txt
unittests/AST/CommentTextTest.cpp [new file with mode: 0644]