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

Learning Eclipse,JDT and the Eclipse Plugin

9 replies
John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.

Hi,

I was about to implement some refactoring in the Eclipse Plugin and
after finally getting everything to compile* and having a test
environment ready I realized that I don't know enought about how
everything fits together.

Can anyone tell me what the shortest path to get up to speed about
everything needed to implement refactoring support in the plugin?

BR,
John

* Had to up Xmx to 2048M and reset the compiler settings to factory
settings to get it to compile.

Btw. There was some error about ScalaSigPrinter not being ASCII when compiling.
In this line:
"\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
from http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala...
the â was unreadable.

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Learning Eclipse,JDT and the Eclipse Plugin

I think I've found what I was looking for.

http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-...

http://www.eclipse.org/articles/Article-LTK/ltk.html

BR,
John

On Sun, Jan 25, 2009 at 2:08 PM, John Nilsson wrote:
> Hi,
>
> I was about to implement some refactoring in the Eclipse Plugin and
> after finally getting everything to compile* and having a test
> environment ready I realized that I don't know enought about how
> everything fits together.
>
> Can anyone tell me what the shortest path to get up to speed about
> everything needed to implement refactoring support in the plugin?
>
> BR,
> John
>
>
> * Had to up Xmx to 2048M and reset the compiler settings to factory
> settings to get it to compile.
>
>
> Btw. There was some error about ScalaSigPrinter not being ASCII when compiling.
> In this line:
> "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
> from http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala...
> the â was unreadable.
>

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Learning Eclipse,JDT and the Eclipse Plugin

Is it possible to have code changes hotswapped while testing the plug-in?

It's kind of annoying to have to restart the entire platform just to
test some small modification.

BR,
John

On Sun, Jan 25, 2009 at 6:06 PM, John Nilsson wrote:
> I think I've found what I was looking for.
>
> http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-...
>
> http://www.eclipse.org/articles/Article-LTK/ltk.html
>
> BR,
> John
>
> On Sun, Jan 25, 2009 at 2:08 PM, John Nilsson wrote:
>> Hi,
>>
>> I was about to implement some refactoring in the Eclipse Plugin and
>> after finally getting everything to compile* and having a test
>> environment ready I realized that I don't know enought about how
>> everything fits together.
>>
>> Can anyone tell me what the shortest path to get up to speed about
>> everything needed to implement refactoring support in the plugin?
>>
>> BR,
>> John
>>
>>
>> * Had to up Xmx to 2048M and reset the compiler settings to factory
>> settings to get it to compile.
>>
>>
>> Btw. There was some error about ScalaSigPrinter not being ASCII when compiling.
>> In this line:
>> "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
>> from http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala...
>> the â was unreadable.
>>
>

Dave Ray
Joined: 2009-01-07,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Learning Eclipse,JDT and the Eclipse Plugin

If it's Java code, Eclipse usually has no problem hot-swapping changes
made while running in the debugger. Just edit the code and save. If
you make a structural change (e.g., rename a field or method) , the
debugger will complain loudly. If it's Scala code, I can't say
because I've never tried :)

Changes to resources like plugin.xml will require a restart.

Dave

On Sun, Jan 25, 2009 at 2:54 PM, John Nilsson wrote:
> Is it possible to have code changes hotswapped while testing the plug-in?
>
> It's kind of annoying to have to restart the entire platform just to
> test some small modification.
>
> BR,
> John
>
> On Sun, Jan 25, 2009 at 6:06 PM, John Nilsson wrote:
>> I think I've found what I was looking for.
>>
>> http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-...
>>
>> http://www.eclipse.org/articles/Article-LTK/ltk.html
>>
>> BR,
>> John
>>
>> On Sun, Jan 25, 2009 at 2:08 PM, John Nilsson wrote:
>>> Hi,
>>>
>>> I was about to implement some refactoring in the Eclipse Plugin and
>>> after finally getting everything to compile* and having a test
>>> environment ready I realized that I don't know enought about how
>>> everything fits together.
>>>
>>> Can anyone tell me what the shortest path to get up to speed about
>>> everything needed to implement refactoring support in the plugin?
>>>
>>> BR,
>>> John
>>>
>>>
>>> * Had to up Xmx to 2048M and reset the compiler settings to factory
>>> settings to get it to compile.
>>>
>>>
>>> Btw. There was some error about ScalaSigPrinter not being ASCII when compiling.
>>> In this line:
>>> "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
>>> from http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala...
>>> the â was unreadable.
>>>
>>
>

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Learning Eclipse,JDT and the Eclipse Plugin

It is Scala code. But there is no hotswapping going on at all, not
even trying. Loud complaints I could take, but silently ignoring
changes...

Could it be some setting? Do I have to do something to force eclipse
to load the class again?

BR,
John

On Sun, Jan 25, 2009 at 9:00 PM, Dave Ray wrote:
> If it's Java code, Eclipse usually has no problem hot-swapping changes
> made while running in the debugger. Just edit the code and save. If
> you make a structural change (e.g., rename a field or method) , the
> debugger will complain loudly. If it's Scala code, I can't say
> because I've never tried :)
>
> Changes to resources like plugin.xml will require a restart.
>
> Dave
>
> On Sun, Jan 25, 2009 at 2:54 PM, John Nilsson wrote:
>> Is it possible to have code changes hotswapped while testing the plug-in?
>>
>> It's kind of annoying to have to restart the entire platform just to
>> test some small modification.
>>
>> BR,
>> John
>>
>> On Sun, Jan 25, 2009 at 6:06 PM, John Nilsson wrote:
>>> I think I've found what I was looking for.
>>>
>>> http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-...
>>>
>>> http://www.eclipse.org/articles/Article-LTK/ltk.html
>>>
>>> BR,
>>> John
>>>
>>> On Sun, Jan 25, 2009 at 2:08 PM, John Nilsson wrote:
>>>> Hi,
>>>>
>>>> I was about to implement some refactoring in the Eclipse Plugin and
>>>> after finally getting everything to compile* and having a test
>>>> environment ready I realized that I don't know enought about how
>>>> everything fits together.
>>>>
>>>> Can anyone tell me what the shortest path to get up to speed about
>>>> everything needed to implement refactoring support in the plugin?
>>>>
>>>> BR,
>>>> John
>>>>
>>>>
>>>> * Had to up Xmx to 2048M and reset the compiler settings to factory
>>>> settings to get it to compile.
>>>>
>>>>
>>>> Btw. There was some error about ScalaSigPrinter not being ASCII when compiling.
>>>> In this line:
>>>> "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
>>>> from http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala...
>>>> the â was unreadable.
>>>>
>>>
>>
>

ijuma
Joined: 2008-08-20,
User offline. Last seen 22 weeks 2 days ago.
Re: Learning Eclipse,JDT and the Eclipse Plugin

Hi,

John Nilsson writes:
> It is Scala code. But there is no hotswapping going on at all, not
> even trying. Loud complaints I could take, but silently ignoring
> changes...

Window -> Preferences -> Java -> Debug has a few Hot Code Replace options.

> Could it be some setting? Do I have to do something to force eclipse
> to load the class again?

With Java, it's automatic so maybe there are some calls the JDT does that the
Scala plugin doesn't.

By the way, it would be really great to have some basic refactoring support. :)

Ismael

Sean McDirmid
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Learning Eclipse,JDT and the Eclipse Plugin
Hotswapping is transparent at the JVM level and just works for Scala as it would for Java. It even works (for me) when developing the IDE using the IDE. The only caveats are related to hot swapping limitations: no new classes, don't add fields to existing classes. Unfortunately, closures are implemented as classes by Scalac, and the naming of a closure is naively sequential, so...you basically can't create new closures during a hot swap session, which basically applies to most Scala code. 

On Mon, Jan 26, 2009 at 3:54 AM, John Nilsson <john@milsson.nu> wrote:
Is it possible to have code changes hotswapped while testing the plug-in?

It's kind of annoying to have to restart the entire platform just to
test some small modification.

BR,
John

On Sun, Jan 25, 2009 at 6:06 PM, John Nilsson <john@milsson.nu> wrote:
> I think I've found what I was looking for.
>
> http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html
>
> http://www.eclipse.org/articles/Article-LTK/ltk.html
>
> BR,
> John
>
> On Sun, Jan 25, 2009 at 2:08 PM, John Nilsson <john@milsson.nu> wrote:
>> Hi,
>>
>> I was about to implement some refactoring in the Eclipse Plugin and
>> after finally getting everything to compile* and having a test
>> environment ready I realized that I don't know enought about how
>> everything fits together.
>>
>> Can anyone tell me what the shortest path to get up to speed about
>> everything needed to implement refactoring support in the plugin?
>>
>> BR,
>> John
>>
>>
>> * Had to up Xmx to 2048M and reset the compiler settings to factory
>> settings to get it to compile.
>>
>>
>>  Btw. There was some error about ScalaSigPrinter not being ASCII when compiling.
>> In this line:
>>            "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
>> from http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scalax/rules/scalasig/ScalaSigPrinter.scala
>> the â was unreadable.
>>
>

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Learning Eclipse,JDT and the Eclipse Plugin

I would be happy if just adding a println would be swapped in.

Maybe it has something to do with the fact that I'm running this on Ubuntu

BR,
John

On Mon, Jan 26, 2009 at 3:06 AM, Sean McDirmid wrote:
> Hotswapping is transparent at the JVM level and just works for Scala as it
> would for Java. It even works (for me) when developing the IDE using the
> IDE. The only caveats are related to hot swapping limitations: no new
> classes, don't add fields to existing classes. Unfortunately, closures are
> implemented as classes by Scalac, and the naming of a closure is naively
> sequential, so...you basically can't create new closures during a hot swap
> session, which basically applies to most Scala code.
>
> On Mon, Jan 26, 2009 at 3:54 AM, John Nilsson wrote:
>>
>> Is it possible to have code changes hotswapped while testing the plug-in?
>>
>> It's kind of annoying to have to restart the entire platform just to
>> test some small modification.
>>
>> BR,
>> John
>>
>> On Sun, Jan 25, 2009 at 6:06 PM, John Nilsson wrote:
>> > I think I've found what I was looking for.
>> >
>> >
>> > http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-...
>> >
>> > http://www.eclipse.org/articles/Article-LTK/ltk.html
>> >
>> > BR,
>> > John
>> >
>> > On Sun, Jan 25, 2009 at 2:08 PM, John Nilsson wrote:
>> >> Hi,
>> >>
>> >> I was about to implement some refactoring in the Eclipse Plugin and
>> >> after finally getting everything to compile* and having a test
>> >> environment ready I realized that I don't know enought about how
>> >> everything fits together.
>> >>
>> >> Can anyone tell me what the shortest path to get up to speed about
>> >> everything needed to implement refactoring support in the plugin?
>> >>
>> >> BR,
>> >> John
>> >>
>> >>
>> >> * Had to up Xmx to 2048M and reset the compiler settings to factory
>> >> settings to get it to compile.
>> >>
>> >>
>> >> Btw. There was some error about ScalaSigPrinter not being ASCII when
>> >> compiling.
>> >> In this line:
>> >> "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "â†'")
>> >> from
>> >> http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala...
>> >> the â was unreadable.
>> >>
>> >
>
>

CadErik
Joined: 2008-12-19,
User offline. Last seen 3 years 43 weeks ago.
RE: Re: Learning Eclipse,JDT and the Eclipse Plugin

> Maybe it has something to do with the fact that I'm running this on
Ubuntu

I don't think so. I have no issues with hotswapping under opensuse 11.1
and Oracle JRockit or the sun JDK. If you are using the openjdk, try
switching to the sun jdk instead. There are small glitches with the
openjdk here and there. And make sure you launch the workspace in debug
mode.

Erik.

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Learning Eclipse,JDT and the Eclipse Plugin

Ah, debug mode! If that's the requirement then no wonder it doesn't work =)

BR,
John

On Mon, Jan 26, 2009 at 10:00 PM, Putrycz, Erik
wrote:
>> Maybe it has something to do with the fact that I'm running this on
> Ubuntu
>
> I don't think so. I have no issues with hotswapping under opensuse 11.1
> and Oracle JRockit or the sun JDK. If you are using the openjdk, try
> switching to the sun jdk instead. There are small glitches with the
> openjdk here and there. And make sure you launch the workspace in debug
> mode.
>
> Erik.
>

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