About: About Caoyuan's Blog
Browse by time:
- April 2010 (1)
- March 2010 (1)
- January 2010 (3)
- December 2009 (3)
- November 2009 (2)
- October 2009 (2)
- September 2009 (5)
- August 2009 (4)
- July 2009 (1)
- June 2009 (3)
- May 2009 (1)
- April 2009 (2)
- March 2009 (3)
- February 2009 (15)
- January 2009 (2)
- December 2008 (4)
- November 2008 (5)
- October 2008 (6)
- September 2008 (1)
- August 2008 (1)
- July 2008 (5)
- June 2008 (1)
- May 2008 (4)
- April 2008 (5)
- March 2008 (7)
- February 2008 (5)
- January 2008 (7)
- December 2007 (8)
- November 2007 (3)
- October 2007 (8)
- September 2007 (4)
- August 2007 (6)
- July 2007 (5)
- June 2007 (1)
- May 2007 (4)
- April 2007 (8)
- March 2007 (3)
- February 2007 (3)
- January 2007 (2)
- December 2006 (2)
- November 2006 (4)
- October 2006 (1)
- September 2006 (2)
- August 2006 (1)
- July 2006 (2)
- June 2006 (5)
- May 2006 (6)
- April 2006 (7)
- March 2006 (2)
- December 2005 (4)
Scala Plugin for NetBeans - Rewrite in Scala #6: Refactoring Step Two - Rename
As I've done most code of Refactoring skeleton, it did not cost me too much time to get renaming feature working (2 hours about). Now, NetBeans' Scala plugin can rename class/method/val etc across project's source files.
Following snapshot shows class "Dog" is going to be renamed to "BigDog?". After the preview, press "Do Refactoring", all things done.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/blog_logo.png)
rss

Comments
Caoyuan,
On just selecting an item in a tree (left part of refactoring preview) have got:
java.lang.NegativeArraySizeException?
[catch] at java.awt.EventQueue?.dispatchEvent(EventQueue?.java:599)
BTW, are you going to expand both 'where used' and 'rename' to all dependent (wrt currently edited) projects?
Caoyuan,
On just selecting an item in a tree (left part of refactoring preview) have got:
java.lang.NegativeArraySizeException?
BTW, are you going to expand both 'where used' and 'rename' to all dependent (wrt currently edited) projects?
Caoyuan,
On just selecting an item in a tree (left part of refactoring preview) have got:
java.lang.NegativeArraySizeException?
BTW, are you going to expand both 'where used' and 'rename' to all dependent (wrt currently edited) projects?
Thank you very much for your work on the scala nb plugin. I am updating it every day to track you progress.
The only real thing that I miss right now is the ability to profile a scala program using the netbeans built-in profiler: when I dynamically attach a profiler in CPU mode to a running scala program (using the maven exec integration in netbeans). However while the memory monitoring work, I can only see java method calls and not a single scala method call.
I have just created a new issue to track this on netbeans.org: <a href=" http://www.netbeans.org/issues/show_bug.cgi?id=171388>[171388]</a>
@Andrew, have you tried to clean and build all scala related plugins? I changed a trait in scala.editor, which makes a need to re-compile, build all related classes even not in same project.
I do have plan to support refactoring across all opened projects.
@ogrisel, for profiler, I use it to track potential memory leak of scala plugin itself one week ago. It's not a easy work to map all JVM instance/variable names to scala one. I mean "not easy" that it needs lots code typing.
Caoyuan,
Yes, I have: every time I build the plugin, I use
ant scala-clean scala-nbm
Then I remove
modules update update_tracking
dirs from user dir, start NB (ignoring exception), redownload all nbms from scala.kit/build, install them and restart the IDE.
Probably there is shorter way :-)
Have I missed something?
As for exception - it arises on few tree items only, not on all ones.
I hope, I have rev 15617 - it was 2 hour ago, and I don't see any new changes in /contrib since last plugin build.
First I wanted to say thanks for all your hard work. It has been a pleasure to watch your plug-in gain so many features in such a short time. As a fellow developer, I salute you!
I'm trying to get the plugin up and running with a simple example out of the box Lift project.
My first problem was that although I set SCALA_HOME, I didn't launch my NetBeans from the command line, so NetBeans wasn't picking this up. That's solved.
However, I'm getting the following error displayed in the editor: <pre>net.liftweb.mapper.MetaMegaProtoUser? does not take type parameters</pre> which isn't a genuine error. The project compiles quite successfully under Maven within NetBeans.
Any thoughts?
P.S. Many thanks for this great Plugin.
FYI - Just noticed that in the latest version of the ScalaKit/Editor?, the ANT property for the Scala Sources had changed from src.dir to src.scala.dir. I had to change the cleanup section in build-impl.xml to get things working again.
It seems, I also see more spread error messages against correct code now. Up to date Scala and plugin are in use.
@Stuart, for the liftweb code, did you has all relative dependent jars built upon Scala-2.8.0? I have not tried to explore liftweb yet, so I have no idea why this happened, it will be great if you can find the cause.
@everybody, if editor shows odd error messages, you can try to reset compiler by right-click in editor window, choose "Reset Scala Compiler" in popup menu.
Caoyuan,
"Reset Scala Compiler" has not visible effect at all few cases I have tried.
@Andrew, which version of 2.8.0 snapshot are you using? maybe I need to upgrade the one that NetBeans's plugin uses itself.
Caoyuan, it's 2.8.0.r18644. Of course, I don't run all my test with every trunk revision, but, at least, all my projects compilable.
@Caoyuan, I downloaded the latest liftweb sources and used these compiled with Scala 2.8. This resulted in a consistency between the errors in NetBeans and compiling through Maven. Now I just need to figure out what's changed and why! :-)
Cheers.
Thank you for your hard work on this. It is greatly appreciated.