Writing a new refactoring plugin for Eclipse?

前端 未结 2 1440
轮回少年
轮回少年 2020-12-02 14:51

Is there any good documentation on implementing new refactorings in Eclipse? Specifically, I\'d like to access the AST for a Java class, make some non-trivial changes, and s

相关标签:
2条回答
  • 2020-12-02 15:14

    You can take a look at Lombok Project. It seems they have Eclipse plugin.

    It does some AST manipulations - e.q. getters/setters. Could be helpful for you too.

    0 讨论(0)
  • 2020-12-02 15:22

    I found the eclipse.org article the most helpful to get me started. To be honest you're probably best off debugging some of the Eclipse refactorings to get a real feel for how they work.

    A good place to get started debugging the code is to set breakpoints on org.eclipse.jdt.core.dom.rewrite.ASTRewrite, particularly the rewriteAST() method, then trigger some refactorings.

    Here are a few you might find useful. Are you looking for anything in particular or a general sense of how to process the AST?

    • http://www.ibm.com/developerworks/opensource/library/os-ast/
    • http://blog.sahits.ch/?p=228
    • http://www.vogella.de/articles/EclipseJDT/article.html
    0 讨论(0)
提交回复
热议问题