Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » imports do not work anymore in Xtext 2.4
imports do not work anymore in Xtext 2.4 [message #995243] Sat, 29 December 2012 09:03 Go to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1305
Registered: July 2009
Senior Member
Hi

I've just installed Xtext 2.4 M4 and I see that import statements seem
broken: I've also tested it with the domain model example (freshly
imported in a new workspace)

and this new test fails

@Test
def void testParsingAndLinkingWithImports() {
'''
import java.util.List
package example {
entity MyEntity {
p : List<String>
}
}
'''.parse.assertNoErrors
}

with

java.lang.AssertionError: Expected no errors, but got :[ERROR:Couldn't
resolve reference to JvmType 'List'. (__synthetic0.dmodel line : 4)]

if I put the fully qualified name it works...

@Test
def void testParsingAndLinkingWithImports() {
'''
import java.util.List
package example {
entity MyEntity {
p : java.util.List<String>
}
}
'''.parse.assertNoErrors
}

is it a known issue?

cheers
Lorenzo


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
Re: imports do not work anymore in Xtext 2.4 [message #996482 is a reply to message #995243] Wed, 02 January 2013 02:25 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Hi Lorenzo,

please file a ticket with your findings. We did some refactorings for
the imports in order to extract a concept 'ImportSection' that can be
used by other languages. Looks like something is broken, now.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 29.12.12 15:03, schrieb Lorenzo Bettini:
> Hi
>
> I've just installed Xtext 2.4 M4 and I see that import statements seem
> broken: I've also tested it with the domain model example (freshly
> imported in a new workspace)
>
> and this new test fails
>
> @Test
> def void testParsingAndLinkingWithImports() {
> '''
> import java.util.List
> package example {
> entity MyEntity {
> p : List<String>
> }
> }
> '''.parse.assertNoErrors
> }
>
> with
>
> java.lang.AssertionError: Expected no errors, but got :[ERROR:Couldn't
> resolve reference to JvmType 'List'. (__synthetic0.dmodel line : 4)]
>
> if I put the fully qualified name it works...
>
> @Test
> def void testParsingAndLinkingWithImports() {
> '''
> import java.util.List
> package example {
> entity MyEntity {
> p : java.util.List<String>
> }
> }
> '''.parse.assertNoErrors
> }
>
> is it a known issue?
>
> cheers
> Lorenzo
>
>
Re: imports do not work anymore in Xtext 2.4 [message #996558 is a reply to message #996482] Wed, 02 January 2013 06:21 Go to previous message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1305
Registered: July 2009
Senior Member
Done

https://bugs.eclipse.org/bugs/show_bug.cgi?id=397304

the problem is present also when using the "latest" update site

cheers
Lorenzo

On 01/02/2013 08:25 AM, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> please file a ticket with your findings. We did some refactorings for
> the imports in order to extract a concept 'ImportSection' that can be
> used by other languages. Looks like something is broken, now.
>
> Regards,
> Sebastian


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
Previous Topic:Check nature of XExpression
Next Topic:[Xtext] IllegalStateException "Stack of grammar elements seems to be corrupt."
Goto Forum:
  


Current Time: Thu Jul 24 04:31:27 EDT 2014

Powered by FUDForum. Page generated in 0.03473 seconds