[scala-ide-dev] Refactoring...

0 views
Skip to first unread message

Kevin Wright

unread,
May 7, 2010, 2:37:24 PM5/7/10
to scala-...@googlegroups.com

So this one will be a question for Mirko then :)

How does the refactoring tool cope in the face of synthetic methods?
A good example would be the getters/setters produced by the @BeanProperty annotation, or some of the stuff done for case classes

I ask because I'm looking to do more of this kind of trickery with compiler-plugins in the future.

--
Kevin Wright

mail/google talk: kev.lee...@googlemail.com
wave: kev.lee...@googlewave.com
skype: kev.lee.wright
twitter: @thecoda

Mirko Stocker

unread,
May 7, 2010, 2:51:01 PM5/7/10
to scala-...@googlegroups.com
On Friday 07 May 2010 20:37:24 Kevin Wright wrote:
> So this one will be a question for Mirko then :)

And here I am :-)

> How does the refactoring tool cope in the face of synthetic methods?
> A good example would be the getters/setters produced by the @BeanProperty
> annotation, or some of the stuff done for case classes

Yes, there's a lot of stuff in the AST generated by the compiler that has no
direct representation in the source code. But luckily, all these Trees have an
Offset-Position, whereas "real" Trees have a RangePosition. For the most parts
in the refactorings, all trees with an OffsetPosition are simply ignored..

> I ask because I'm looking to do more of this kind of trickery with
> compiler-plugins in the future.

As long as all the new things you introduce have OffsetPositions, the
refactorings won't be irritated :-)

Cheers

Mirko

--
Mirko Stocker | m...@misto.ch
Work: http://ifs.hsr.ch | http://infoq.com
Personal: http://misto.ch | http://twitter.com/m_st

Kevin Wright

unread,
May 7, 2010, 3:03:15 PM5/7/10
to scala-...@googlegroups.com
Okay, so that fits pretty close to my expectations.  Hopefully it'll all "just work" with what I've already done.

A few tests are in order, but I'm confident :)
Reply all
Reply to author
Forward
0 new messages