This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Adding "organize imports" functionality to the Scala Eclipse plugin

8 replies
Oge
Joined: 2010-03-15,
User offline. Last seen 42 years 45 weeks ago.

Hello Mirko Stockers and everyone else on the list,

I just learnt Scala recently and really love it. I would like to use
the Eclipse plugin for development but some of the nice features of
the Java plugin, like "organize imports", are not yet available.
According to this bug http://lampsvn.epfl.ch/trac/scala/ticket/390
this is the right venue to work on the bug.

Could anyone point a Scala internals' noob to documentation on how to
start hacking the Scala Eclipse plugin, and what a good approach for
attacking the "organize imports" bug is?

Thanks in advance for your help,

Ogechi Nnadil

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Adding "organize imports" functionality to the Scala Eclip

On Mon, Mar 15, 2010 at 12:37 PM, Oge wrote:
> Hello Mirko Stockers and everyone else on the list,
>
> I just learnt Scala recently and really love it. I would like to use
> the Eclipse plugin for development but some of the nice features of
> the Java plugin, like "organize imports", are not yet available.
> According to this bug http://lampsvn.epfl.ch/trac/scala/ticket/390
> this is the right venue to work on the bug.
>
> Could anyone point a Scala internals' noob to documentation on how to
> start hacking the Scala Eclipse plugin, and what a good approach for
> attacking the "organize imports" bug is?

Mirko is working on an IDE independent refactoring framework which
will be open for community contributions very soon. I met with Mirko
in London last week and saw his prototype of "Organize imports"
relative to this framework, and it's absolutely awesome ... its
character count isn't all that much longer than this mail. It will be
going into the Scala IDE as soon as is possible consistently with the
constraints of Mirko's Masters ... I'm hoping that we'll be able to
make an announcement at Scala Days if not before.

The best place to look for documentation right now is Mirko's Trac
which is here,

http://scala.ifs.hsr.ch/

I encourage anyone who is interested in Scala refactorings, whichever
IDE (or none) they favour, to get behind Mirko's project.

Cheers,

Miles

ijuma
Joined: 2008-08-20,
User offline. Last seen 22 weeks 2 days ago.
Re: Adding "organize imports" functionality to the Scala Eclip

On Tue, Mar 16, 2010 at 12:02 AM, Miles Sabin wrote:
> Mirko is working on an IDE independent refactoring framework which
> will be open for community contributions very soon. I met with Mirko
> in London last week and saw his prototype of "Organize imports"
> relative to this framework, and it's absolutely awesome

Very nice!

Best,
Ismael

Ben Hutchison 3
Joined: 2009-11-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Adding "organize imports" functionality to the Scala Eclip
On Tue, Mar 16, 2010 at 11:02 AM, Miles Sabin <miles [at] milessabin [dot] com> wrote:
Mirko is working on an IDE independent refactoring framework which
will be open for community contributions very soon. I met with Mirko
in London last week and saw his prototype of "Organize imports"
relative to this framework, and it's absolutely awesome ... its
character count isn't all that much longer than this mail. It will be
going into the Scala IDE as soon as is possible consistently with the
constraints of Mirko's Masters ... I'm hoping that we'll be able to
make an announcement at Scala Days if not before.

Ive had a quick scan of Mirkos technical report. It looks promising, but I am wondering how resilient it will be in the face of source code with compile errors in it? I didn't notice any discussion of this issue?

That's surely an important, almost must-have, capability for an "Add Imports" feature in the long term...?

-Ben
Clint Gilbert 2
Joined: 2010-03-16,
User offline. Last seen 42 years 45 weeks ago.
Re: Adding "organize imports" functionality to the Scala Eclip

Indeed. In the short term, I'd settle for being able to
ctrl-space-complete the names of classes. Currently, if I have some
code like

class XYZ

object Foo {
def bar() = {
...
}
}

and, with my cursor inside bar(), I type

val x = new X

I don't get prompted for completions of the class name. It's a drag.
The Java editor offers completions, and adds an import if neccessary
when you choose one. Is this supposed to work with the Scala plugin?

Ben Hutchison wrote:
> On Tue, Mar 16, 2010 at 11:02 AM, Miles Sabin > wrote:
> Mirko is working on an IDE independent refactoring framework which
> will be open for community contributions very soon. I met with Mirko
> in London last week and saw his prototype of "Organize imports"
> relative to this framework, and it's absolutely awesome ... its
> character count isn't all that much longer than this mail. It will be
> going into the Scala IDE as soon as is possible consistently with the
> constraints of Mirko's Masters ... I'm hoping that we'll be able to
> make an announcement at Scala Days if not before.
>
> Ive had a quick scan of Mirkos technical report. It looks promising, but I am wondering how resilient it will be in the face of source code with compile errors in it? I didn't notice any discussion of this issue?
>
> That's surely an important, almost must-have, capability for an "Add Imports" feature in the long term...?
>
> -Ben
>

Mirko Stocker
Joined: 2009-09-10,
User offline. Last seen 45 weeks 6 days ago.
Re: Adding "organize imports" functionality to the Scala Eclips

Hi all

On Tuesday 16 March 2010 01:02:31 Miles Sabin wrote:
> Mirko is working on an IDE independent refactoring framework which
> will be open for community contributions very soon. I met with Mirko
> in London last week and saw his prototype of "Organize imports"
> relative to this framework, and it's absolutely awesome ... its
> character count isn't all that much longer than this mail.

Thanks for the kind words :-)

> It will be
> going into the Scala IDE as soon as is possible consistently with the
> constraints of Mirko's Masters ... I'm hoping that we'll be able to
> make an announcement at Scala Days if not before.

I'm also preparing a howto/blog that will show how refactorings can be built
and run (don't worry, you won't need any IDE setup, just the Scala compiler
and a jar), so I can get feedback on what works and how the API should look
like.

Once I've worked out the licensing issues with my professor, Miles and I plan
to make the whole source code more easily accessible than it is right now, and
of course also to integrate it into Eclipse.

Cheers

Mirko

Mirko Stocker
Joined: 2009-09-10,
User offline. Last seen 45 weeks 6 days ago.
Re: Adding "organize imports" functionality to the Scala Eclips

On Tuesday 16 March 2010 02:45:52 Ben Hutchison wrote:
> Ive had a quick scan of Mirkos technical report. It looks promising, but I
> am wondering how resilient it will be in the face of source code with
> compile errors in it? I didn't notice any discussion of this issue?

The term project focused only on Extract Method, where it isn't a big problem.

But actually, and I was surprised myself, the current organize imports works
fine even if there are syntax errors in the file :-)

Cheers

Mirko

Stefan Liebig
Joined: 2009-02-17,
User offline. Last seen 42 years 45 weeks ago.
Can not install Eclipse Plugin in Eclipse IDE 3.6M6

I can neither install 2.7.7.final nor the nightly build in Eclipse 3.6M6.
The update manager (p2) complains:
An error occurred while collecting items to be installed
session context was:(profile=SDKProfile,
phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=,
action=).
No repository found containing:
osgi.bundle,org.aspectj.weaver,1.6.7.200912311949

Are there any known restrictions?

Tschüß,
Stefan

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Can not install Eclipse Plugin in Eclipse IDE 3.6M6

On Wed, Mar 17, 2010 at 6:44 AM, Stefan Liebig
wrote:
> I can neither install 2.7.7.final nor the nightly build in Eclipse 3.6M6.

Eclipse Milestone builds aren't (currently) supported. You'll need to use 3.5.x.

Cheers,

Miles

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland