Community
Participate
Working Groups
The problem starts when the user creates a conditional breakpoint in any line of code. If the user wants to edit the breakpoint using the functionality breakpoint properties, once the editor is open to create the condition, if the user press CTRL + SPACE over the sentence “this.equals([ctrl+space])”; the result is the following exception. This is the stack trace with the exception that we got from eclipse error log…. java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:2926) at org.eclipse.swt.SWT.error(SWT.java:2865) at org.eclipse.swt.SWT.error(SWT.java:2836) at org.eclipse.swt.custom.StyledText.getLocationAtOffset (StyledText.java:3874) Attached is provided the complete stack…. Thanks, and let me know if you need more information to reproduce the error. Regards. Raul.
Please provide more complete steps to reproduce. I.e. example source file, condition, and point at which code assist was attempted. You could also try 3.2 M5 (soon to be released), to see if the problem still exists there. Thanks.
Moving to JFace Text. Looks like we set up the offset correctly, but it gets changed along the way. Will attach screenshot.
Created attachment 35783 [details] Screen shot of call stack We set up the offset as 12 in this case, but it gets changed to a "visible offet" of 844 in this case. I don't know where the visible offset is coming from.
To reproduce, create a line breakpoint on the first line of junit.samples.VectorTest#testCapacity(). Then open the breakpoint properties edtior and code assist in a condition like "this.equals(|)".
The code assist source and viewer source (document) don't match. The offset comes from CompletionProposal.getCompletionLocation() which is based on the code assist source. This is used when context information of a used proposal is requested. You have two choices: 1) make the document match the code assist source and use ITextViewer.setVisibleRegion(int, int) to only show the inserted text (the one currently visible in the dialog) 2) try to adjust the offset in the ProposalContextInformation using setContextInformationPosition()
Actually Debug is using the snippet based code complete method from J Core which should adjust that offset. Moving to J Core as discussed with David.
Fixed and tests added SnippetCompletionContextTests#test0001() -> test0004() Now the completion location is relative to the snippet. Note: the completion location was -1 if the completion occurs at the start of the snippet and CompletionProposal doesn't support negative location. I added a workaround to avoid that: -1 is replaced by 0. I enter a bug about this problems in completion positions (bug 128276). As a fix for bug 128276 require API modifications perhaps bug 128276 won't be fixed for 3.2.
>I enter a bug about this problems in completion positions... see bug 132558.
Oups...'bug 128276' should be 'bug132558' in comment 7.
Verified using I20060328-0010 for 3.2M6