Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-text-dev] Fw: info for implementors of ICompletionProposal


----- Forwarded by Claude Knaus/ZRH/OTI on 25.11.2002 10:13 -----
Claude Knaus

22.11.2002 19:16

       
        To:        platform-text-dev@xxxxxxxxxxx
        cc:        
        Subject:        Fw: info for implementors of ICompletionProposal



----- Forwarded by Claude Knaus/ZRH/OTI on 22.11.2002 19:22 -----
Claude Knaus

22.11.2002 18:25

       
        To:        platform-text-dev@xxxxxxxxxxx
        cc:        
        Subject:        info for implementors of ICompletionProposal


A heads up for implementors of ICompletionProposal (used by content assist):

When a completion proposal applies a change to a document, it usually is the case
that only these document changes are actually applied to the document.
However, in certain cases (like when being in linked position mode - used in templates and
others) a document change can trigger other document changes. Up to now, this
was not of concern, since these document changes always happened to the
right of the original document change.

Due to a new change in the linked position mode, it is now possible to trigger document
changes which are to the left of the originating document change. The effect is that
if the resulting selection calculated based on the assumption that no additional
document changes are triggered to left of the original document change, the
selection might become invalid.
In concrete, this can happen if a template is active and content assist is issued
on a position, which is not the left most of its position type.

To correctly implement ICompletionProposal.getSelection(), a document listener should be
installed during ICompletionProposal.apply() to keep track of possibly additional affecting
document changes. This can also be done by inserting a document position with an
apropriate document position updater (see JavaCompletionProposal for how this can
be done). The idea is to track a hopefully 'stable' reference point during the document
changes. The selection should then be calculated with respect to this reference point.

Note: This is not considered as an API change. It's just that so far, the API was underspecified.

-- Claude

Back to the top