Bug 16879 - Double click after { does not always select the right block of code.
Summary: Double click after { does not always select the right block of code.
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC2   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 16952 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-22 11:56 EDT by Eduardo Pereira CLA
Modified: 2003-03-18 04:59 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo Pereira CLA 2002-05-22 11:56:35 EDT
Past the following code in a java text editor
	public void foo() {
		String aString = "AAAAAAAAAAAAAAAAA";
		String s1[] = new String[]{aString};
		String s2[] = new String[]{"aaaa"};
		Object o1[] = new Object[][]{{aString},{aString}};
	}

1) Doubleclick after { in the line "String s1[]". It will select the code 
between { and }. Good.
2) Now doubleclick after the first { in the line "String s2[]". It will select 
aaaa without including the ". It should select everything between { and }.
3) Now doubleclick after the first { in the line "Object o1[]". It will select 
the contents of the second { instead of the first one.
Comment 1 Kai-Uwe Maetzel CLA 2002-09-04 06:16:54 EDT
*** Bug 16952 has been marked as a duplicate of this bug. ***
Comment 2 Kai-Uwe Maetzel CLA 2002-09-05 04:51:14 EDT
Related to #9503 and #9151.
Comment 3 Kai-Uwe Maetzel CLA 2002-09-11 09:37:50 EDT
*** Bug 23089 has been marked as a duplicate of this bug. ***
Comment 4 Nick Edgar CLA 2003-02-13 09:53:18 EST
Can this be considered for 2.1?
Thanks
Comment 5 Randy Hudson CLA 2003-02-13 10:38:46 EST
I hope this does get changed.
BTW, "Highlight matching brackets" has the same problem and needs to use the 
same algorithm.
Comment 6 Kai-Uwe Maetzel CLA 2003-03-04 06:11:43 EST
Build > 20030304 for those who cannot stand having a cursor right or left of 
a '{' :-)
Comment 7 Randy Hudson CLA 2003-03-17 15:43:34 EST
This does not work in RC2.  RC2 behavior is:

int a = 1(2int3)4long;

double-clicking at:
1 - does nothing, working
2 - selects text, working
3 - does nothing, broken
4 - selects text, broken, should do nothing.

Also:
String foo = 1"2foo3"4;

double-clicking should only be supported at 2&3, but 1 also works.
Comment 8 Kai-Uwe Maetzel CLA 2003-03-18 04:59:18 EST
As you have seen the current behavior is that selection is only triggered when 
the cursor/mouse event is/happens right of a bracket. Thus, when being inside 
nested brackets you always know for which one the matching bracket is computed 
and highlighted. This resolves the ambiguities you initially complained about.