Interface ICompletionProposalExtension
- All Known Implementing Classes:
TemplateProposal
public interface ICompletionProposalExtension
Extends
ICompletionProposal
with the following functions:
- handling of trigger characters other than ENTER
- completion proposal validation for a given offset
- context information can be freely positioned
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the proposed completion to the given document.intReturns the position to which the computed context information refers to or-1if no context information can be provided by this completion proposal.char[]Returns the characters which trigger the application of this completion proposal.booleanisValidFor(IDocument document, int offset) Returns whether this completion proposal is valid for the given position in the given document.
-
Method Details
-
apply
Applies the proposed completion to the given document. The insertion has been triggered by entering the given character at the given offset. This method assumes thatisValidFor(IDocument, int)returnstrueif called foroffset.- Parameters:
document- the document into which to insert the proposed completiontrigger- the trigger to apply the completionoffset- the offset at which the trigger has been activated
-
isValidFor
Returns whether this completion proposal is valid for the given position in the given document.- Parameters:
document- the document for which the proposal is testedoffset- the offset for which the proposal is tested- Returns:
trueiff valid
-
getTriggerCharacters
char[] getTriggerCharacters()Returns the characters which trigger the application of this completion proposal.- Returns:
- the completion characters for this completion proposal or
nullif no completion other than the new line character is possible
-
getContextInformationPosition
int getContextInformationPosition()Returns the position to which the computed context information refers to or-1if no context information can be provided by this completion proposal.- Returns:
- the position to which the context information refers to or
-1for no information
-