Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Handling of multiple contextTypes for code completion

Hi Gerald,

Actually in our language implementations we not use multiple template
contexts.
So if you have some ideas in this area, please feel free to send patches
via Eclipse bug tracker.

Best regards,
Andrei.

> Have a circumstance where Templates belonging to two different
> contextTypes need to be presented together for code completion --
> specific use case is where script language statements can be embedded
> with otherwise ordinary Java statements, so both standard java (pulled
> from the JDT templates) and script templates need to be shown in the
> same completion popup.
>
> Overriding ScriptTemplateCompletionProcessor #getTemplates(String
> contextTypeId) to alias one contextTypeId to multiple and return the
> combined set of templates works nicely. 
>
> The problem is that
> ScriptTemplateCompletionProcessor#computeCompletionProposals (at line
> 104 in the 1.0M6 source) includes a separate contextType check that is
> both redundant and not easily overrideable:
>
>         // Addes check of startsWith
> *         if* (template.getName().startsWith(prefix)
>                  && _template.matches(prefix,
> *context.getContextType().getId()*)_)
>
> Line 91 already constrains the template to the proper contextType Id
> and line 103 already checks the prefix.  I have tested removing the
> redundant check and it works nicely, at least for my intended purpose.
>
> 1) is there a better DLTK-way of combining multiple contextType templates?
> 2) if not, any reason not to remove this redundant check?
> 3) is bugzilla being used actively and should the bug
> report/enhancement request be entered there?
>
> Thanks,
> Gerald
> ------------------------------------------------------------------------
>
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>   



Back to the top