Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 180397 - Instance variables assigned with parallel assignment are not included in auto complete list
Summary: Instance variables assigned with parallel assignment are not included in auto...
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Ruby (show other bugs)
Version: 0.95   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Mikhail Kalugin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 197465
  Show dependency tree
 
Reported: 2007-04-01 19:06 EDT by Michael Klishin CLA
Modified: 2008-05-26 02:49 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Klishin CLA 2007-04-01 19:06:59 EDT
Build ID: I20070323-1616

Steps To Reproduce:
1.Open up Ruby editor.
2.Past the following class in there:

class BaseTemplate
  attr_accessor :variable_template
			
  def initialize(name, abbrev, body, description)
    @name = name
    @shortcut, @body, @description = shortcut, body, description
				
    # Template variable
    @variable_template = /\$\{\w+\}/ # ${variable}
  end			

  def variable_gsub_expession
    "${\\1}"
  end
		
  # Parses template body
  def parse_body(variable_template)
    gsub_entities_in_body!
    		
  end			
	
  protected
	
  def gsub_entities_in_body!
    subs = {
      /"/ => '"',
      /
/ => "\n"
    }
    							
    subs.each { |k, v| @body.gsub!(k, v) }			  
  end
end

3. Try to call auto complete in parse_body method. As you can see @name and @variable_template, assigned using singular assignment, are completed okay, while other variables are absent in the list.


More information:
More on parallel assignment gotchas in Ruby at http://www.rubycentral.com/book/tut_expressions.html
Comment 1 Mikhail Kalugin CLA 2007-04-27 06:44:01 EDT
Fixed.
Comment 2 Eclipse Webmaster CLA 2007-07-29 09:22:16 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 3 Andrey Platov CLA 2008-05-26 02:49:52 EDT
bulk change: fixed in 0.95