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.

Bug 98852

Summary: Code completion for attr_accessor, class variables not working
Product: ruby Reporter: fabian_e <fabian_e>
Component: EditingAssignee: Torbjorn Norbye <tor>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description fabian_e 2007-03-23 21:37:24 UTC
Code completion doesn't work for attr_accessor and class variables, e.g.:

#super song
class Song
  @@songcounter=0
  #new comment
  def initialize(name="test")
    @@songcounter=@@songcounter+1
    @name=name
  end
  attr_accessor :age, :name
  def sing(text="lala")
    puts text
  end
end

ss = Song.new()
ss.sing # is completed
ss.age # not completed
ss.songcounter # is not shown, but
ss.@@songcounter # is shown
Comment 1 Torbjorn Norbye 2007-06-19 22:47:17 UTC
The attributes part (attr_accessor) has been fixed; "age" does show up in code completion now. Classvars still need to be fixed.
Comment 2 Jiri Kovalsky 2007-07-03 13:59:07 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 3 Torbjorn Norbye 2008-08-23 05:42:09 UTC
This should be working now. I don't think it's valid to try to access the fields directly like that on an object (indeed
if I try to run the code, it gives an error message).  The attributes are properly included.