Skip to main content



      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 12:29 Go to next message
Eclipse UserFriend
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 03:35 Go to previous messageGo to next message
Eclipse UserFriend
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 05:58 Go to previous messageGo to next message
Eclipse UserFriend
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 06:15 Go to previous messageGo to next message
Eclipse UserFriend
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 07:09 Go to previous messageGo to next message
Eclipse UserFriend
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 07:15 Go to previous messageGo to next message
Eclipse UserFriend
@ian, does your project have yourdsls facet?
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743221 is a reply to message #1743220] Tue, 13 September 2016 07:31 Go to previous messageGo to next message
Eclipse UserFriend
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 09:46 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743239 is a reply to message #1743235] Tue, 13 September 2016 10:02 Go to previous messageGo to next message
Eclipse UserFriend
i just gave it a try with

ideaVersion = '162.646.4'

and that worked
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743735 is a reply to message #1743239] Mon, 19 September 2016 06:29 Go to previous messageGo to next message
Eclipse UserFriend
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 07:03 Go to previous messageGo to next message
Eclipse UserFriend
is it intended you still use xtext 2.9?
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743738 is a reply to message #1743735] Mon, 19 September 2016 07:08 Go to previous messageGo to next message
Eclipse UserFriend
ps: do you have a example model as well?
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743856 is a reply to message #1743738] Tue, 20 September 2016 05:32 Go to previous messageGo to next message
Eclipse UserFriend
@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 125 times)
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743860 is a reply to message #1743738] Tue, 20 September 2016 05:43 Go to previous messageGo to next message
Eclipse UserFriend
@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 05:43 Go to previous messageGo to next message
Eclipse UserFriend
@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 05:44 Go to previous messageGo to next message
Eclipse UserFriend
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 06:49 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743879 is a reply to message #1743877] Tue, 20 September 2016 06:53 Go to previous messageGo to next message
Eclipse UserFriend
(the bigus thing in scope seems getMickeyModelInScope)
Re: Namespace Global Scoping not working properly in IntelliJ [message #1743900 is a reply to message #1743879] Tue, 20 September 2016 09:34 Go to previous message
Eclipse UserFriend
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: Tue Jul 08 11:17:34 EDT 2025

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

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

Back to the top