Community
Participate
Working Groups
M6: (Demonstrated by the OCLinEcore.xtext in org.eclipse.ocl.examples.xtext.* as of today's date). My core EssentialOCL grammar uses a variety of punctuation elements such as {, } as well as using 'e' and 'E in two ways (real exponent and Identifier contribution). My OCLinEcore grammar extends the EssentialOCL grammar and introduces new rules that also involve punctuation elements such as {, }. When I try to define a CodeTemplate for the OCLinEcore grammar using the Window->Preferences->OCLinEcore->Tempaltes page, the list of contexts offers me "Keyword '{'" and "Keyword 'e'" twice, presumably once from each grammar. Is this an indication of deeper problems in store, or just an inelegance? Which of the keywords should I use for Code Templates. Is there a multi-selection facility?
There shouldn't be duplicte entries in the default list for template contexts.
Reproducible with v2.10
see org.eclipse.xtext.ui.editor.templates.XtextTemplateContextTypeRegistry.registerContextTypes(IGrammarAccess, Provider<XtextTemplateContextType>) i asume we should (additionally to handle the keywords) do there something similar to org.eclipse.xtext.ui.codetemplates.scoping.CodetemplatesScopeProvider.scope_Codetemplate_context(Codetemplate, EReference) i am not sure if we need the duplicate keywords anyway. (for super rulecalls)
i did some testing. since the contexts are both needed we need to distingusish both values. this may lead to some adoptions to org.eclipse.xtext.ui.codetemplates.ui.preferences.EditTemplateDialog.getContextName() as well