View | Details | Raw Unified | Return to bug 192497 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/ResolveTests.java (+22 lines)
Lines 2115-2118 Link Here
2115
		elements
2115
		elements
2116
	);
2116
	);
2117
}
2117
}
2118
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=192497
2119
public void testSelectOnCursor1() throws JavaModelException {
2120
	ICompilationUnit cu = getWorkingCopy(
2121
			"/Resolve/src/AType.java",
2122
			"public class AType {\n" +
2123
			"  public void doLoad(){}\n" +
2124
			"  public void foo() {\n" +
2125
			"    doLoad();\n" +
2126
			"  }\n" +
2127
			"}\n");
2128
	
2129
	String str = cu.getSource();
2130
	// perform code select between 'd' and 'o'
2131
	int start = str.indexOf("oLoad();");
2132
	int length = 0;
2133
	IJavaElement[] elements = cu.codeSelect(start, length);
2134
	assertElementsEqual(
2135
		"Unexpected elements",
2136
		"doLoad() [in AType [in [Working copy] AType.java [in <default> [in src [in Resolve]]]]]",
2137
		elements
2138
	);
2139
}
2118
}
2140
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java (-2 / +2 lines)
Lines 341-348 Link Here
341
		int token;
341
		int token;
342
		
342
		
343
		if(selectionStart > selectionEnd){
343
		if(selectionStart > selectionEnd){
344
			// compute end position of the selection
344
//			int end = selectionEnd + 1 == source.length ? selectionEnd : selectionEnd + 1;
345
			int end = selectionEnd + 1 == source.length ? selectionEnd : selectionEnd + 1;
345
			int end = source.length - 1;
346
			
346
			
347
			// compute start position of current line
347
			// compute start position of current line
348
			int currentPosition = selectionStart - 1;
348
			int currentPosition = selectionStart - 1;

Return to bug 192497