This post explains how to contribute your templates in the Dynamic Languages Toolkit (DLTK) editor's content assist. Its a common requirement to incorporate your custom library API's into existing API, hence provide developer with larger domain of predefined functionality to work with.
The second step is to incorporate the options in all the existing IDE tools(the post covers only content assist) so that developer can easily leverage.
There are couple extension point which make your job hell lot easier, following are the abstract dummy steps to accomplish the same:
1. First of all there is a extension point="org.eclipse.dltk.ui.scriptCompletionProposalComputer" which essentially requires the ancestor as org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalComputer (or its parent), apart from this some declarative options are also there.
2. Secondly you can provide static templates in the form of xml file via extension point="org.eclipse.ui.editors.templates" it has child element as contextType which has attribute class (takes subclass of org.eclipse.dltk.ui.templates.ScriptTemplateContextType) and id which resolves you content assist.
3. Last but importantly giving developer a way to contribute its templates to be featured in the content assist which can be done via extending org.eclipse.ui.preferencePages, while keep the id of its child element page same as in step two
Only couple of classes and configuration can take you there :).
The second step is to incorporate the options in all the existing IDE tools(the post covers only content assist) so that developer can easily leverage.
There are couple extension point which make your job hell lot easier, following are the abstract dummy steps to accomplish the same:
1. First of all there is a extension point="org.eclipse.dltk.ui.scriptCompletionProposalComputer" which essentially requires the ancestor as org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalComputer (or its parent), apart from this some declarative options are also there.
2. Secondly you can provide static templates in the form of xml file via extension point="org.eclipse.ui.editors.templates" it has child element as contextType which has attribute class (takes subclass of org.eclipse.dltk.ui.templates.ScriptTemplateContextType) and id which resolves you content assist.
3. Last but importantly giving developer a way to contribute its templates to be featured in the content assist which can be done via extending org.eclipse.ui.preferencePages, while keep the id of its child element page same as in step two
Only couple of classes and configuration can take you there :).
Comments
Post a Comment