Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xbase: Organize imports removes imported model packages
Xbase: Organize imports removes imported model packages [message #1602305] Thu, 05 February 2015 13:06 Go to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 107
Registered: July 2009
Senior Member
Hi,

In a simple Xbase language (like Domainmodel example) I would like to reference plain DSL (EMF) objects defined in other DSL model files.

Importing using

import mypackage.*


works, but yields a warning

- The use of wildcard imports is deprecated.

Also the import statement get removed during organize imports Sad

My question is, how can I import and reference plain DSL objects (without corresponding inferred Java-classes) defined in different files?

Thank you!

Cheers,
Boris


PS
By the way, is it correct, that I also have to import my own package, like

package org.test
import org.test.*
....

Re: Xbase: Organize imports removes imported model packages [message #1603542 is a reply to message #1602305] Fri, 06 February 2015 08:17 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3098
Registered: July 2009
Senior Member
Hi Boris,

Xbase's XImportSection is designed and implemented to allow imports of
JvmTypes. Other objects are not taken into account. Please take a look
at Xcore's specialization to see how to deal with DSL concepts.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Xbase: Organize imports removes imported model packages [message #1608061 is a reply to message #1603542] Mon, 09 February 2015 08:43 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 107
Registered: July 2009
Senior Member
Hi Sebastian,


thank you! I had suspected that...

And what about imporing own package?

Two files

package a

Object X1

and
package a

Object X2 {
  val X1 x1
}

produces #["a.X1", "a.X2"] in the global scope. But referencing X1 from X2 searches only for "X1" and finds nothing.

Shouldn't object's own package be auto-imported like in Java?


Cheers,
Boris
Re: Xbase: Organize imports removes imported model packages [message #1608383 is a reply to message #1608061] Mon, 09 February 2015 13:25 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3098
Registered: July 2009
Senior Member
Hi Boris,

generally yes. Is 'X1' in 'val X1 x1' implemented by a JvmTypeReference
and is the value properly put into a type with the package name 'a'?

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Xbase: Organize imports removes imported model packages [message #1608389 is a reply to message #1608383] Mon, 09 February 2015 13:34 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 107
Registered: July 2009
Senior Member
Hi Sebastian,

Ah, it should be JvmTypeReference? It's a Plain Old EMF Object... I guess, I have to implement this auto-importing myself.

Thank you!

Cheers,
Boris
Re: Xbase: Organize imports removes imported model packages [message #1782668 is a reply to message #1603542] Tue, 27 February 2018 14:29 Go to previous message
Martin Trummer is currently offline Martin TrummerFriend
Messages: 17
Registered: December 2017
Junior Member
Quote:

Xbase's XImportSection is designed and implemented to allow imports of
JvmTypes. Other objects are not taken into account. Please take a look
at Xcore's specialization to see how to deal with DSL concepts.


This great Advanced Xtext Manual has very detailed explanations for the underlying conepts.
Previous Topic:configure multiple generators with XText 2.9
Next Topic:Custom formatter not registred
Goto Forum:
  


Current Time: Tue Jun 19 05:08:49 GMT 2018

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

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

Back to the top