custom code completion in Editor text field

Hi,

I have a plugin, with a settings page that has a list of templates. These templates will have code in velocity, java and custom xml tags.
I am using com.intellij.openapi.editor.ex.EditorEx (EditorTextField) for editing or adding new template.
I need to provide code completion for this editor. On typing # completion for velocity should be popped.
On typing < and 1st charecter of tag name, completion for custom tag should appear.
On $ all velocity variables, on SPACE within the tag(custom), attibutes(custom) for the tag should be shown and so on.
I m not sure if i have to use PsiReference or CompletionContributor, to get this working. Please suggest how this can be achieved.
Please help me with some code examples for both the cases.

0

Please sign in to leave a comment.