Summary: | Cannot always find method definition, depending on cursor position | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Koen van Dijken <koen.van.dijken> | ||||||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | daniel_megert, jerome_lanneluc | ||||||||
Version: | 3.3 | ||||||||||
Target Milestone: | 3.3.1 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Koen van Dijken
2007-06-13 13:29:51 EDT
reproduced in 3.3 RC4. ICompilationUnit.codeResolve is called with the offset 'o' in doLoad();. No result returned. This is a regression added by the fix for bug 161400. The problem is caused by SelectionEngine#checkSelection(). To reproduce the problem the cursor must be inside an identifier. A part of the identifier must correspond to a keyword and the cursor must be just before the last character of the keyword. eg. d|oLoad fo|rmat This is not a common case but this is a regression. We should fix this bug for 3.3.1. Created attachment 71305 [details]
Proposed fix
checkSelection() must scan from the beginning of the line to the end of the source instead of from the beginning of the line to the cursor location.
Released for 3.4M1. Test added: ResolveTests#testSelectOnCursor1() I will prepare a patch for 3.3.1. Created attachment 72945 [details]
Proposed patch for 3.3.1
The bug is a regression and the fix isn't risky.
With this patch checkSelection() the end position of the scanner is set to the end of the source file instead of to the cursor position to be able to fully scan the selected token.
Only the first token is scanned so move the end position won't have impact on performance.
Created attachment 72946 [details]
Proposed patch for 3.3.1
The bug is a regression and the fix isn't risky.
With this patch checkSelection() the end position of the scanner is set to the end of the source file instead of to the cursor position to be able to fully scan the selected token.
Only the first token is scanned so move the end position won't have impact on performance.
+1 for 3.3.1 Released for 3.3.1 Test added: ResolveTests#testSelectOnCursor1() Verified for 3.4M1 using build I20070802-0800. Verified for 3.3.1 using M20070831-2000 |