Skip to main content



      Home
Home » Modeling » TMF (Xtext) » customise plugin.xml
customise plugin.xml [message #1745460] Tue, 11 October 2016 04:24 Go to next message
Eclipse UserFriend
Hi,
I'm creating an idea plugin, and I want to customise the oultine.
I found that instruction in plugin_gen.xml :
		<lang.psiStructureViewFactory 
			language="MyLanguage"
			factoryClass="MyLanguageExtensionFactory"
			implementationClass="com.intellij.lang.PsiStructureViewFactory"
		/>


How do I instruct the plugin to use my own implementation (something like MyLanguageStructureViewFactory) instead of com.intellij.lang.PsiStructureViewFactory ?

Is there another way to create a custom outline view in idea ?

Thanks
Herve
Re: customise plugin.xml [message #1746033 is a reply to message #1745460] Thu, 20 October 2016 12:32 Go to previous message
Eclipse UserFriend
Xtext uses dependency injection to set up the infrastructure of your language.
The MyLanguageExtensionFactory makes sure that the injector is used to create an instance of the implementationClass at runtime.

In order to get your implementation in, you have to extend PsiStructureViewFactory, and bind your implementation to the class PsiStructureViewFactory in the MyLanguageIdeaModule, e.g. by adding

Class<? extends PsiStructureViewFactory> bindPsiStructureViewFactory() {
return MyLanguageStructureViewFactory
}

See also the Xtext documentation on dependency injection.
Previous Topic:Cross Referencing an already crossreferenced element in xtext doesn't work
Next Topic:Help with Generate Infrastructure MWE - create generator package
Goto Forum:
  


Current Time: Sat May 17 06:19:47 EDT 2025

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

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

Back to the top