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 91222 - code completion could provide e.g. local context in #{}
Summary: code completion could provide e.g. local context in #{}
Status: VERIFIED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-18 16:15 UTC by Tomas Danek
Modified: 2007-07-03 14:42 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2006-12-18 16:15:06 UTC
#191:
-----------------
have a code

def someMethdod(param)
    puts "Parameter is: #{param}."
end

would be nice if cc provides some hints inside of #{} e.g. instance variables,
method parameters, and variables in local context.
Comment 1 Tomas Danek 2006-12-18 16:25:04 UTC
I've played with this a little, seems like it works, but you have to invoke CC
*inside* - i.e. place cursor inside of brackets #{} ant then it works.
CC did not work for me, because i typed

puts "Parameter is: #{

and invoked CC. But if i close the curly bracket and close string literal, it
starts to work.
Comment 2 Torbjorn Norbye 2006-12-18 18:39:38 UTC
Right. The problem is that when the quotes are not closed, parsing fails, and
code completion relies on parsing. There are two strategies to deal with this:

1) Make the parser more resilient such that it can recover conditions like these
and only mark a part of the parse tree as erroneous.

2) (Shorter term) Fix pair-matching such that when you insert for example a ", I
insert a matching " unless once is already there. I implemented this already,
but it really got in the way (because the algorithm to figure out whether one is
there already was not right) so I punted on it until I had migrated to using the
lexer APIs (such that my APIs can be token based rather than character based).
That's done now, so I should visit the pair-matcher again.  This will still not
work right in many cases, e.g. if you type an opening block and I don't insert a
matching close block (I should use indentation to try to figure out what to do)
the parser will again be confused, but I'll see what I can do.
Comment 3 Torbjorn Norbye 2007-02-02 19:38:05 UTC
I've made a number of fixes in this area; this works now in most cases. You get
code completion inside nested Ruby code, and in most cases it's able to cope
with partially broken source to offer completion. Pair matching enhancements
also help in this area.
Comment 4 Tomas Danek 2007-05-25 14:49:44 UTC
unable to reproduce in 070525
Comment 5 Jiri Kovalsky 2007-07-03 13:58:39 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 6 Jiri Kovalsky 2007-07-03 14:42:26 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.