Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363793

Summary: tutorial "Five simple steps to your JVM language" contains some pitfalls
Product: [Modeling] TMF Reporter: Lorenzo Bettini <lorenzo.bettini>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: btickets, sven.efftinge
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: v2.5

Description Lorenzo Bettini CLA 2011-11-15 05:19:46 EST
I've just tried the Five simple steps to your JVM language tutorial and when trying the editor it all seems to work (and I added the xtext nature to the project), but for expressions like these:

op getFullName() : String {
            return firstName + " " + name;
        }

op getFriendsSortedByFullName() : List<Person> {
            return friends.sortBy( f | f.fullName);
        }

with errors:

Couldn't resolve reference to JvmIdentifiableElement '+'.   
Couldn't resolve reference to JvmIdentifiableElement 'sortBy'.   

The problem is that the documentation, in the section "Try the Editor" is slightly confusing: it says to create a Java project in the runtime workspace; however, in order to use the '+' for strings, and the extension sortBy you need to

# create a plugin project (instead of a Java project)
# add the dependency 'org.eclipse.xtext.xbase.lib'
Comment 1 Dietmar Stoll CLA 2013-12-02 07:19:17 EST
The documentation now says: "Xbase relies on a small runtime library on the class path. To add this, right-click on the project and go to Java Build Path -> Libraries -> Add Library and choose Xtend Library"

So I guess this is fixed.
Comment 2 Sven Efftinge CLA 2013-12-02 08:18:18 EST
yes, thanks for checking.
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:05:03 EDT
Requested via bug 522520.

-M.
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:16:26 EDT
Requested via bug 522520.

-M.