Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Namespace Global Scoping not working properly in IntelliJ
Namespace Global Scoping not working properly in IntelliJ [message #1721213] Mon, 25 January 2016 17:29 Go to next message
Christian Franzen is currently offline Christian FranzenFriend
Messages: 4
Registered: February 2013
Junior Member
Hi all.

At the moment I am trying to migrate our Eclipse-based XText DSL (based on v2.8.3) to IntelliJ IDEA 15 (with XText 2.9.1). I was able to manage all that build stuff to generate separate plugins for Eclipse and for IDEA and everything seems to work fine. At least in Eclipse.

Unfortunately in IDEA the content assist / global scoping seems to not work correctly. Our DSL is distributed over several files and we are referencing the entities from other files using the ImportedNamespaceAwareLocalScopeProvider. That is working fine in Eclipse but it is not working in IDEA. I am only able to resolve entities from local scope (same file) there. Any idea what is going wrong here? Is there any configuration necessary to make that work in IDEA?

Regards
Christian
Re: Namespace Global Scoping not working properly in IntelliJ [message #1721262 is a reply to message #1721213] Tue, 26 January 2016 08:35 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 83
Registered: January 2016
Location: Kiel
Member

No, it should work out of the box.
If you can build an example to reproduce, please file a bugzilla ticket and attach it.

Sven
Re: Namespace Global Scoping not working properly in IntelliJ [message #1721569 is a reply to message #1721262] Thu, 28 January 2016 10:58 Go to previous messageGo to next message
Christian Franzen is currently offline Christian FranzenFriend
Messages: 4
Registered: February 2013
Junior Member
Here is the bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=486716
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743209 is a reply to message #1721213] Tue, 13 September 2016 10:15 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
I am also experiencing this issue, has it been confirmed? I see a bug report but no resolution to this Sad
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743218 is a reply to message #1721213] Tue, 13 September 2016 11:09 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Hey Christian,

Did you manage to solve this issue?
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743220 is a reply to message #1743218] Tue, 13 September 2016 11:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
@ian, does your project have yourdsls facet?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743221 is a reply to message #1743220] Tue, 13 September 2016 11:31 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Hey @Christian thanks for the response, I could not find the facet for my DSL so added it, but it made no difference Sad

Re: Namespace Global Scoping not working properly in IntelliJ [message #1743235 is a reply to message #1743221] Tue, 13 September 2016 13:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hmmm very strange.

unfortunately intellij setup is very unhandy. thus it would be nice to have a project i can simply run gradle on or maven to reproduce.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743239 is a reply to message #1743235] Tue, 13 September 2016 14:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i just gave it a try with

ideaVersion = '162.646.4'

and that worked


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743735 is a reply to message #1743239] Mon, 19 September 2016 10:29 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Thanks @Christian I tried that but still no joy, I am stilling using the old AbstractDeclaritiveScopeProvider and maybe that has something to do with it, but not sure.

Intellij keeps rewriting my files:

  public IScope scope_DropTriggerStatement_trigger(final DropTriggerStatement context, final EReference ref) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method getModel(EObject) from the type ModelUtil refers to the missing type MickeyFile"
      + "\ndatabaseName cannot be resolved");
  }
  
  public IScope scope_MigrationBlock_from(final MigrationBlock context, final EReference ref) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method getModel(EObject) from the type ModelUtil refers to the missing type MickeyFile"
      + "\ndatabaseName cannot be resolved");
  }


and not able to debug, I am thinking it might be best to use Eclipse instead and try target intellij instead but it would have been nice.

I attached the project that global scoping fails to work as it did in eclipse, It seems that I can't reference symbols from one file to the other anymore like it did in Eclipse.

Re: Namespace Global Scoping not working properly in IntelliJ [message #1743737 is a reply to message #1743735] Mon, 19 September 2016 11:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
is it intended you still use xtext 2.9?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743738 is a reply to message #1743735] Mon, 19 September 2016 11:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
ps: do you have a example model as well?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743856 is a reply to message #1743738] Tue, 20 September 2016 09:32 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
@Christian, I guess I intend to use the latest xtext that works with Intellij since most of the Android community have moved to Android Studio and wanted to revive this project.

Please find the model files attached! Smile
  • Attachment: model.zip
    (Size: 7.60KB, Downloaded 93 times)
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743860 is a reply to message #1743738] Tue, 20 September 2016 09:43 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
@Christian, I guess I intend to use the latest xtext that works with Intellij since most of the Android community have moved to Android Studio and wanted to revive this project.

Please find the model files attached! Smile
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743862 is a reply to message #1743738] Tue, 20 September 2016 09:43 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
@Christian, I guess I intend to use the latest xtext that works with Intellij since most of the Android community have moved to Android Studio and wanted to revive this project.

Please find the model files attached! Smile
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743863 is a reply to message #1743862] Tue, 20 September 2016 09:44 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Sorry my internet connection caused multiple posts, please see first reply with model attached
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743877 is a reply to message #1743863] Tue, 20 September 2016 10:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
maybe anton can have a look and give us some insights.

unfortunately your util classes give me in eclipse compile errors as well.
and your workflow seems bogus since the parser seems not to be generated sometimes . maybe cause antlr runs into timeouts. maybe you need to configure better ones.

and your scope implementation looks wired to me. i assue there somewhere exceptions are thrown around and swallowed somewhere by xtext.
unfortunately this is a crap to analyze with intellij. maybe registering a error handler for the polymorphic dispatcher in the abstractdeclarativescopeprovider helps.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743879 is a reply to message #1743877] Tue, 20 September 2016 10:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
(the bigus thing in scope seems getMickeyModelInScope)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743900 is a reply to message #1743879] Tue, 20 September 2016 13:34 Go to previous message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
thanks for having a look @Christian ! Smile I am still at a loss to how to get it to work and its possible that I was doing some non-standard things since the idea of the DSL is to build a database from migrations so the code attempts to build a snapshot by traversing cross-referenced links Sad
Previous Topic:Error deploying Xtext-Web war
Next Topic:Couldn't resolve reference to Grammar
Goto Forum:
  


Current Time: Sat Apr 20 02:29:53 GMT 2024

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

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

Back to the top