[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM. `getExtendedRange` is a really good choice! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58556/new/ https://reviews.llvm.or

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Ignore my previous comment, I'll take another look Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58556/new/ https://reviews.llvm.org/D58556 ___ cfe-commits mailing list c

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Ah, had some comments and forgot to send them out before I went on vacation :-( Comment at: clang/include/clang/Tooling/FixIt.h:60 +// future to include more associated text (like comments). +CharSourceRange getSourceRangeAuto(const Stmt &S, ASTCo

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190039. ymandel marked an inline comment as done. ymandel edited the summary of this revision. ymandel added a comment. Remove unneeded includes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58556/new/ https:/

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 7 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:73 +// context. In contrast with \p getText(), this function selects a source range +// "automatically", extracting text that a reader might intuitively associ

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190037. ymandel marked an inline comment as done. ymandel edited the summary of this revision. ymandel added a comment. This update significantly simplifies the change. It removes any "smarts", instead allowing the user to request the extension of the source

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-05 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:73 +// context. In contrast with \p getText(), this function selects a source range +// "automatically", extracting text that a reader might intuitively associate +// with a node. Currently, only specia

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:73 +// context. In contrast with \p getText(), this function selects a source range +// "automatically", extracting text that a reader might intuitively associ

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-05 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:73 +// context. In contrast with \p getText(), this function selects a source range +// "automatically", extracting text that a reader might intuitively associate +// with a node. Currently, only specia

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-02-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:60 +// future to include more associated text (like comments). +CharSourceRange getSourceRangeAuto(const Stmt &S, ASTContext &Context); + ilya

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-02-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Thanks, the APIs totally make sense. And seem to fit into the other functions we have in `FixIt.h`, although the name of the file is somewhat misleading. Mostly comments about naming and one comment about the necessity of using matchers from my side. ===

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-02-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. ymandel added a project: clang. Herald added a subscriber: jdoerfert. Introduces variants of `getText` and `getSourceRange` that extract the source text of an AST node based on contextual considerations. This revision intro