[PATCH] D27054: Introducing clang::tooling::EditList for refactoring tools.
Manuel Klimek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 30 04:41:46 PST 2016
klimek added inline comments.
================
Comment at: include/clang/Tooling/Refactoring/EditList.h:41
+ /// \brief Creates an edit list for a key position.
+ EditList(const SourceManager &SM, SourceLocation KeyPosition);
+
----------------
ioeric wrote:
> djasper wrote:
> > I wonder whether we should always use a SourceLocation as key or whether we want to leave this up to the users. E.g. we could make this take a string parameter and provide a
> >
> > string getKeyForLocation(const SourceManager &SM, SourceLocation KeyPosition);
> I think the key idea of EditList is that it groups a set of edits around a key position. For refactoring, using position as key makes sense to me (since all edits will be around some position), and I couldn't think of other things that are good to be a key here.
An idea would be an edit that just inserts multiple headers, but does not directly touch a source location (thus, we might want to key things off of files?).
https://reviews.llvm.org/D27054
More information about the cfe-commits
mailing list