Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextActivator instead of <MyLang>Activator
XtextActivator instead of <MyLang>Activator [message #1745783] Mon, 17 October 2016 14:13 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
I just start to use xtext 2.10

after the generation process,
in the ui.internal package, I found a class named XtextActivator instead of <MyLanguage>Activator.

Is it normal?
How can i customize it?

best regards,
Re: XtextActivator instead of <MyLang>Activator [message #1745784 is a reply to message #1745783] Mon, 17 October 2016 14:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
yes and no,

it depends on your language and plugin naming how the activator i named.
thus: can you share a reproducable example?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: XtextActivator instead of <MyLang>Activator [message #1745785 is a reply to message #1745784] Mon, 17 October 2016 14:18 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Yes!
this is my generator

module fr.irit.fiacre.xtext.GenerateFiacre

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "fr.irit.fiacre.xtext"
				rootPath = rootPath
				eclipsePlugin = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "UTF-8"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "fr.irit.fiacre.xtext.Fiacre"
			fileExtensions = "fcr"
			
			grammarAccess = grammarAccess.GrammarAccessFragment2 auto-inject{}
			emfGenerator = ecore.EMFGeneratorFragment2 auto-inject{}
			serializer = {
				generateStub = false
			}
			
			validator = validation.ValidatorFragment2 {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
			scopeProvider = scoping.ImportNamespacesScopingFragment2 auto-inject{}
			qualifiedNamesProvider = exporting.QualifiedNamesFragment2 auto-inject{}
			builder = builder.BuilderIntegrationFragment2 auto-inject{}
			generator = generator.GeneratorFragment2 auto-inject{}
			formatter =formatting.Formatter2Fragment2 auto-inject{}
			labelProvider=ui.labeling.LabelProviderFragment2 auto-inject{}
			outline=ui.outline.OutlineTreeProviderFragment2 auto-inject{}
			quickOutline = ui.outline.QuickOutlineFragment2 auto-inject{}
			quickFixProvider = ui.quickfix.QuickfixProviderFragment2 auto-inject{}
			contentAssist =ui.contentAssist.ContentAssistFragment2 auto-inject{}
			parserGenerator = parser.antlr.XtextAntlrGeneratorFragment2 {
				options={
					backtrack=true
					classSplitting=true
					fieldsPerClass="500"
				}
			}
			junitSupport =auto-inject {}
			renameRefactoring = auto-inject{}
			resourceFactoryFragment = auto-inject{}
			compareEditor = auto-inject{}
		}
	}
}

Re: XtextActivator instead of <MyLang>Activator [message #1745798 is a reply to message #1745785] Mon, 17 October 2016 15:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
i assume it is derived from this one fr.irit.fiacre.xtext

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: XtextActivator instead of <MyLang>Activator [message #1745799 is a reply to message #1745798] Mon, 17 October 2016 15:15 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Ok
But why all others classes names contain Fiacre like, AbstractFiacreUiModule, FiacreExecutableExtensionFactory, AbstractFiacreProposalProvider, FiacreQuickfixProvider, FiacreDescriptionLabelProvider etc...
Re: XtextActivator instead of <MyLang>Activator [message #1745801 is a reply to message #1745799] Mon, 17 October 2016 15:28 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
with the same grammar and generator in xtext 2.8.4, I obtained a FiacreActivator generated class
Re: XtextActivator instead of <MyLang>Activator [message #1745805 is a reply to message #1745801] Mon, 17 October 2016 15:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
Yes that is a change in the generator to derive the activator from plugin name

I cannot tell you why this was done


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: XtextActivator instead of <MyLang>Activator [message #1745960 is a reply to message #1745805] Wed, 19 October 2016 21:26 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 83
Registered: January 2016
Location: Kiel
Member

We did it to support multiple languages in one project. There can only be one activator per project.
Previous Topic:How to generate code from Xbase expressions
Next Topic:Cross Referencing an already crossreferenced element in xtext doesn't work
Goto Forum:
  


Current Time: Sat Dec 14 01:06:36 GMT 2024

Powered by FUDForum. Page generated in 0.03655 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top