Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext Intellij Quick FIx
Xtext Intellij Quick FIx [message #1733654] Mon, 30 May 2016 13:40 Go to next message
Eclipse UserFriend
Hello,

I've implemented a quickfix using ISemanticModification interface.
I'de like to enable/do same thing using Intellij plugin.

Is it possible? Is there a sample somewhere?

Alternative using content assist?

Thanks for help
Re: Xtext Intellij Quick FIx [message #1733658 is a reply to message #1733654] Mon, 30 May 2016 14:28 Go to previous message
Eclipse UserFriend
Hi,

No, you cannot use ISemanticModification for IntelliJ, since it is Eclipse specific API.

Please have a look at MyDslIntentionsProvider in the attached example. It registers an instance of CapitalizeNameIntentionAction intention for the invalid name issue. An intention in Intellij is an action that is used to fix a particular problem, similar to quick fixes in Eclipse. This intention uses document API to change the content. As an alternative you can change the psi model which will be synchronized with the document later. MyDslIntentionsProvider is bound in MyDslIdeaModule as an implementation of IdeaIntentionsProvider interface.

FYI:
1. get source code of Intellij CE and use Intellij to navigate whenever you have a question regarding usage of some Intellij API;
2. get familiar with basics of Intellij: http://www.jetbrains.org/intellij/sdk/docs/basics.html.

Regards,
Anton

[Updated on: Mon, 30 May 2016 14:29] by Moderator

Previous Topic:TemplateProposal does not get inserted any more
Next Topic:Gradle RunIdea task error
Goto Forum:
  


Current Time: Sun Jul 06 06:43:57 EDT 2025

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

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

Back to the top