Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363793 - tutorial "Five simple steps to your JVM language" contains some pitfalls
Summary: tutorial "Five simple steps to your JVM language" contains some pitfalls
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.5
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-15 05:19 EST by Lorenzo Bettini CLA
Modified: 2017-10-31 11:16 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.