Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] ASTRewrite rewrite


Recent development of Codan (and Refactoring) more and more often uses ASTRewrite, and - logically - more and more reveals problems with it. Currently known issues mentioned here and there on Bugzilla include:

- rewriting from scratch a whole Editor section from the first change to the last, even when everything inside is unchanged
- unwinding macros
- eating comments
- generating wrong formatting
- requiring the file to be saved (unlike JDT, where you can do quick fixes and refactoring directly on a dirty working copy, without forcing save)
- lack of reasonable ability to get file locations of newly created AST nodes (they are needed to create neat linked editor sections for user input after refactoring)
- other strange magic (bug 321071 for instance)

There's been some significant progress on patching the most dramatic issues (see for example bug 296192 and especially its subtasks), but there are still a lot of open issues (like the first bullet point of my list), rooting in some design decisions between ASTRewrite.


I'm considering whether it is feasible to actually rewrite this module on different assumptions (work on a working copy, don't concatenate all singular changes to one big mega-change as it's done now, try to keep the result as close to original as possible). Let me stress that ASTWriter (the part responsible for generating new code fragments) works cool and the "only" thing I'm referring to right now is how the code changes are incorporated later on. Still not a small task, but might be worth a shot... And probably a big step towards JDT's quality in terms of editor experience.

What do you think?

Best regards,
Tomasz Wesołowski

Back to the top