This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using NB 6 M9, and Ruby Editing plugin v 0.62 Invoking instant rename (command - 'r') results in the error message "Cannot perform instant rename here", in every context that I can think of: over local, instance, and global variables, both where they are declared and where they are used. Either I don't understand this feature, or it isn't working.
This works for me. Can you isolate this down to a simple scenario where I can reproduce it? It works only for local variables, parameters and dynamic variables. For example: def (foo) print foo bar = 5 print bar [1,2,3].each { |baz| print baz } end In the above, you should be able to instant rename foo, bar and baz - any reference to them (e.g. both "declaration" and usage.)
I create a new Ruby Application project. I remove all code from main.rb, and then paste in: def (foo) print foo bar = 5 print bar [1,2,3].each { |baz| print baz } end I save the file, and the cursor over 'foo', 'bar', and 'baz', both decl and reference, and in all six cases, typing command + r results in the "Cannot perform instance rename".
Sorry, there was an error in my example (I typed code into issuezilla, I didn't cut & paste). It's missing a function name; replace def (foo) with def bar(foo) At this point, does instant renaming work? You can't use it on uncompileable source code.
I added the method name, and now instant rename works, in all six contexts. I swear that for the longest time, I couldn't get this to work. Perhaps every time I tried it, there was a syntax error somewhere in my file.
I've modified it such that it now gives more specific error messages; in particular, if it can't rename due to parsing errors, it should say so. IDE:------------------------------------------------- IDE: [5/22/07 5:05 PM] Committing started Checking in gsf/api/src/org/netbeans/api/gsf/InstantRenamer.java; /cvs/scripting/gsf/api/src/org/netbeans/api/gsf/InstantRenamer.java,v <-- InstantRenamer.java new revision: 1.2; previous revision: 1.1 done Checking in gsf/src/org/netbeans/modules/editor/retouche/Bundle.properties; /cvs/scripting/gsf/src/org/netbeans/modules/editor/retouche/Bundle.properties,v <-- Bundle.properties new revision: 1.2; previous revision: 1.1 done Checking in gsf/src/org/netbeans/modules/editor/retouche/InstantRenameAction.java; /cvs/scripting/gsf/src/org/netbeans/modules/editor/retouche/InstantRenameAction.java,v <-- InstantRenameAction.java new revision: 1.3; previous revision: 1.2 done Checking in ruby/editing/manifest.mf; /cvs/scripting/ruby/editing/manifest.mf,v <-- manifest.mf new revision: 1.59; previous revision: 1.58 done Checking in ruby/editing/nbproject/project.xml; /cvs/scripting/ruby/editing/nbproject/project.xml,v <-- project.xml new revision: 1.22; previous revision: 1.21 done Checking in ruby/editing/src/org/netbeans/modules/ruby/Bundle.properties; /cvs/scripting/ruby/editing/src/org/netbeans/modules/ruby/Bundle.properties,v <-- Bundle.properties new revision: 1.5; previous revision: 1.4 done Checking in ruby/editing/src/org/netbeans/modules/ruby/RenameHandler.java; /cvs/scripting/ruby/editing/src/org/netbeans/modules/ruby/RenameHandler.java,v <-- RenameHandler.java new revision: 1.5; previous revision: 1.4 done Checking in ruby/kit/nbproject/project.xml; /cvs/scripting/ruby/kit/nbproject/project.xml,v <-- project.xml new revision: 1.90; previous revision: 1.89 done Checking in gsf/nbproject/project.xml; /cvs/scripting/gsf/nbproject/project.xml,v <-- project.xml new revision: 1.22; previous revision: 1.21 done Checking in gsf/nbproject/project.properties; /cvs/scripting/gsf/nbproject/project.properties,v <-- project.properties new revision: 1.44; previous revision: 1.43 done Checking in ruby/kit/manifest.mf; /cvs/scripting/ruby/kit/manifest.mf,v <-- manifest.mf new revision: 1.72; previous revision: 1.71 done Checking in gsf/api/manifest.mf; /cvs/scripting/gsf/api/manifest.mf,v <-- manifest.mf new revision: 1.21; previous revision: 1.20 done IDE: [5/2
Reassigning this issue to newly created 'ruby' component.
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.