[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-16 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332458: [AST] Added a helper to extract a user-friendly text of a comment. (authored by ibiryukov, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Comment at: include/clang/AST/RawCommentList.h:138 + /// the overload with ASTContext in the rest of the code. + std::string getFormattedText(const SourceManager &Sour

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 146757. ilya-biryukov added a comment. - Removed the overload that accepts ASTContext Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST/CommentLexer.h include/clang/AST/RawCommentList.h lib/AST/CommentLexer.cpp l

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-11 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: include/clang/AST/RawCommentList.h:138 + /// the overload with ASTContext in the rest of the code. + std::string getFormattedText(const SourceManager &SourceMgr, + DiagnosticsEngine &Diags) const; --

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-11 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 146326. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Simplify test code with SourceManagerForFile. Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST/CommentLexer.h include/clang/AS

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for adding the tests! Comment at: include/clang/AST/RawCommentList.h:138 + /// the overload with ASTContext in the rest of the code. + std::string getFormattedText(const SourceManager &SourceMgr, + DiagnosticsEngine

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-08 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 145691. ilya-biryukov added a comment. - Fixed infinite loop with comments that contain doxygen commands Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST/CommentLexer.h include/clang/AST/RawCommentList.h lib/AST/C

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-08 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/AST/RawCommentList.cpp:376 +SourceMgr.getSpellingColumnNumber(Tok.getLocation(), &LocInvalid); +if (LocInvalid) + TokColumn = 0; ioeric wrote: > This is a bit confusing... Could you please add

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-05-08 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 145683. ilya-biryukov marked 3 inline comments as done. ilya-biryukov added a comment. Herald added a subscriber: mgorny. - Move unit tests from clangd code to AST tests - Assert locations are valid - Address review other comments Repository: rC Clan

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-26 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Looks good. We still need tests though :) Comment at: lib/AST/RawCommentList.cpp:376 +SourceMgr.getSpellingColumnNumber(Tok.getLocation(), &LocInvalid); +if (LocInvalid) + TokColumn = 0; This is a bit confusing... Could

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked 4 inline comments as done. ilya-biryukov added inline comments. Comment at: include/clang/AST/RawCommentList.h:118 + /// // Parts of it might be indented. + /// /* The comments styles might be mixed. */ + /// into ioeric wrote:

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 144083. ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. - Remove tryLexCommands(), call into helper that parses commands directly - Addressed other review comments Repository: rC Clang https://reviews.llvm.org/D46000

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/AST/RawCommentList.h:118 + /// // Parts of it might be indented. + /// /* The comments styles might be mixed. */ + /// into I'm trying to understand how these cases and RawComment work. For t

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/AST/RawCommentList.cpp:380 +SourceMgr.getSpellingColumnNumber(Tok.getLocation(), &LocInvalid); +if (LocInvalid) + TokColumn = 0; ilya-biryukov wrote: > ioeric wrote: > > Explain when this would

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 143930. ilya-biryukov added a comment. - Fix indentation Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST/CommentLexer.h include/clang/AST/RawCommentList.h lib/AST/CommentLexer.cpp lib/AST/RawCommentList.cpp In

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 143929. ilya-biryukov added a comment. - Update a comment after latest changes Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST/CommentLexer.h include/clang/AST/RawCommentList.h lib/AST/CommentLexer.cpp lib/AST/

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/AST/CommentLexer.cpp:471 + case '\r': +TokenPtr = skipNewline(TokenPtr, CommentEnd); +formTokenWithChars(T, TokenPtr, tok::newline); ioeric wrote: > Can we share code with `lexCommentTextWi

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 143928. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Attempt to reuse lexing code with/without command parsing. - Get rid of SkipWs. Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D46000#1077926, @ioeric wrote: > Overall looks good. Could you add tests for the new methods? Sure. There are a few tests in https://reviews.llvm.org/D46002, but I haven't (yet) moved them to clang. Repository: rC Clang https://re

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Overall looks good. Could you add tests for the new methods? Comment at: lib/AST/CommentLexer.cpp:294 void Lexer::lexCommentText(Token &T) { + if (ParseCommands) +lexCommentTextWithCommands(T); micro-nit: I'd probably ``` return Pa

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 143881. ilya-biryukov added a comment. Added forgotten bits of the change Repository: rC Clang https://reviews.llvm.org/D46000 Files: include/clang/AST/CommentLexer.h include/clang/AST/RawCommentList.h lib/AST/CommentLexer.cpp lib/AST/RawCo

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added reviewers: sammccall, hokein, ioeric. The helper is used in clangd for documentation shown in code completion and storing the docs in the symbols. See https://reviews.llvm.org/D45999. This patch reuses the code of the Doxygen comment lexer,