Bug 132558 - Bug and inconsistancy in completion positions
Summary: Bug and inconsistancy in completion positions
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-20 11:21 EST by David Audel CLA
Modified: 2009-08-30 02:13 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2006-03-20 11:21:59 EST
Seen during writing of a fix for bug 128276.

Currently:

- CompletionProposal#getCompletionLocation() return the position of the character just before the completion point and is not supposed to be negative. Unlike documented in the Javadoc this is not equals to the offset parameter of ICodeAssist#codeComplete().

- CompletionProposal#getTokenEnd() return the position of the character just after the last character of the completion token.

- CompletionContext#getOffset() return the position of the character just after the completion point.

-CompletionContext#getTokenEnd() return the position of the last character of the completion token. Unlike documented in the Javadoc getTokenEnd() is not equals to getTokenStart() when completion token is empty.



So some behaviors don't respect the API and CompletionContext and CompletionProposal don't have consistant behaviors.
Comment 1 David Audel CLA 2006-03-20 12:42:24 EST
A workaround for the bug of negative positions has been added in the fix for bug 128276. This workaround must be removed when this bug will be fixed.
Comment 2 David Audel CLA 2006-03-20 12:59:21 EST
A fix for this bug require to modify some API behaviors. getCompletionLocation() could return the position of the character just after the completion point.

It is too late in 3.2 to change these behaviors because it could break clients. So i will modify Javadoc to describe the real behavior of some of these API and defer the correction of this problem post 3.2.
Comment 3 David Audel CLA 2006-03-22 05:00:20 EST
I updated the javadoc of CompletionProposal#getCompletionLocation() and CompletionContext#getTokenEnd() (see bug 132651)

Post 3.2.
Comment 4 Denis Roy CLA 2009-08-30 02:13:24 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.