Search code examples
javaeclipseautocompleteeclipse-plugineclipse-wtp

eclipse plug-in extension point for CompletionProposal inserted/used


I have extended my eclipse xml-auto-completion proposals as shown in this tutorial.

Further on, I'd like to manipulate the underlying xml-document (e.g. add additional sub-elements to the selected node) when one of my suplied proposals is inserted, but I can't find any extension point matching.

Is there a solution within the org.eclipse.jface.text.contentassist package that I'm missing or can someone give me a hint which extension point would be useful ?


Solution

  • You could write your own implementation of ICompletionProposal rather than using the provided CompletionProposal class (which is final so it can't be extended).

    The void apply(IDocument document) method is called to apply the completion proposal to the current document - you should be able to do what you want in this method.