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 111951 - expand selection should stop at string boundry
Summary: expand selection should stop at string boundry
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 blocker (vote)
Assignee: issues@ruby
Depends on:
Reported: 2007-08-03 20:23 UTC by jamespb
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description jamespb 2007-08-03 20:23:38 UTC
Put the cursor in a string, hit shift-alt-.

Seems like it should select the string first, then the block the string is in.

Product Version: NetBeans Ruby IDE 070803 Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 System: Windows Vista
version 6.0 running on x86; Cp1252; en_US (nbrubyide) Userdir: C:\Users\James\AppData\Roaming\.nbrubyide\dev
Comment 1 Torbjorn Norbye 2007-08-04 02:43:05 UTC
It already does - at least for my unit tests which covers this. For example,

def test
   "return^ me"

With the caret in the middle of the string (indicated by ^), the first alt-shift-. selects  "return me" (including the quotes), the second dot selects the def-

Does that scenario work for you?  If not, I'll need to add some logging to see what happens on your platform. If it does work, it's presumably broken for a 
different scenario; can you show the full code snippet as well as the caret position?
Comment 2 jamespb 2007-08-04 16:45:47 UTC
Darn - sloppy report, I should have captured the text, since I agree it works most of the time.

This fails:

    def self.does_not_reset_timeout
      define_method_with_value :reset_timeout?, false
      a = {'foo'}

with the cursor in 'foo'

This isn't legal Ruby - I was in the middle of editing it, and wanted to change 'foo'
Comment 3 Torbjorn Norbye 2007-08-07 23:24:34 UTC
Thanks. This feature depends on the parse tree, and in the presence of invalid Ruby, the parse tree is incomplete which is why this is happening. 

I should however be able to switch parts of the code over to using lexical information; I'm already doing that to make smart selection handle comments as a 
block (comments are not in the AST) and I've been thinking it would be good to do this for strings anyway since the JRuby parse tree is weird when it comes to 
strings that contain #{}'s.
Comment 4 jamespb 2007-08-07 23:50:52 UTC
That sounds like a good idea - seems like a big chunk of the time I want features like this is when I'm in the middle of
creating code, so things are incomplete/unparseable.
Comment 5 Erno Mononen 2009-05-21 12:33:31 UTC
Too late for 6.7.