Browsing Scala compiler source with Eclipse.

13 views
Skip to first unread message

Chapin, Peter @ VTC

unread,
Apr 3, 2012, 3:47:33 PM4/3/12
to scala...@googlegroups.com

I’m interesting in browsing around the Scala compiler source in order to learn about how it works, etc. My approach is probably pretty naïve but it seems to somewhat work. I do have a question.

 

First… what I did:

 

1.       I unpacked the scala-compiler.jar and scala-library.jar for version 2.9.1 into the same folder.

2.       I started up Eclipse with the latest Scala IDE plugin. I told Eclipse that I wanted to define a new Scala project from existing sources… the sources I previously unpacked.

 

After some tweaking this mostly does what I want. In particular I can browse around the source and use, for example, F3 to jump to declarations of things. There are some quirks still.

 

Now my question. Because the scala-library.jar is also part of the project Eclipse thinks many things are multiply defined. It sees them in the source code of my “project” and in one of the libraries I’m using. If I try to remove scala-library.jar from the project I get an evil message from the presentation compiler and I am told (in strong terms) that I should add that library back.

 

I’m wondering if there is a way around this. I’m not very expert with Eclipse so I’m thinking there is a better way to set up the project than what I’m doing. Has anyone tried using Eclipse to browse around the stock source code? Note that I’m not using a checked out version of the development code base. I’m just using the source as distributed in the standard jar files.

 

Thanks!

 

Peter

 

Mirko Stocker

unread,
Apr 4, 2012, 4:59:13 AM4/4/12
to scala...@googlegroups.com
On Tuesday 03 April 2012 15:47:33 Chapin, Peter @ VTC wrote:
> I'm wondering if there is a way around this. I'm not very expert with
> Eclipse so I'm thinking there is a better way to set up the project than
> what I'm doing. Has anyone tried using Eclipse to browse around the stock
> source code?

The Scala-IDE website has a tutorial on how to set-up Eclipse for compiler
development:

http://scala-ide.org/docs/tutorials/scalac-trunk/index.html

I realize it's not exactly what you want to do, but there might be some
information in there that helps you.

Cheers,

Mirko

--
Mirko Stocker | m...@misto.ch
Work: http://ifs.hsr.ch | http://infoq.com
Personal: http://misto.ch | http://twitter.com/m_st

Reply all
Reply to author
Forward
0 new messages