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

LineNumberTable for Scala scripts

2 replies
Ilya Sergey
Joined: 2009-02-02,
User offline. Last seen 42 years 45 weeks ago.
Hello, folks!

Trying to implement support for Scala scripting in IntelliJ plugin we figured out, that there is no appropriate LineNumberTable produced for class, generated from appropriate script. This fact impedes to provide debugging support.  Also it would be great, if generated class would have name, dependent from initial script file name, but not vanilla "Main".
Is it possible to imllement it in the near-term future?
Thanks.

Kind regards,
Ilya
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: LineNumberTable for Scala scripts

On Thu, Feb 12, 2009 at 12:24:38AM +0100, Ilya Sergey wrote:
> Trying to implement support for Scala scripting in IntelliJ plugin we
> figured out, that there is no appropriate LineNumberTable produced for
> class, generated from appropriate script. This fact impedes to provide
> debugging support. Also it would be great, if generated class would have
> name, dependent from initial script file name, but not vanilla "Main".
> Is it possible to imllement it in the near-term future?

I noticed some of the linenumbertables were borked a while back when I was looking into classfile redundancy, but I never
opened a ticket about it. Can you open a ticket in trac? I will take a look.

https://lampsvn.epfl.ch/trac/scala

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: LineNumberTable for Scala scripts

On Thu, Feb 12, 2009 at 12:24:38AM +0100, Ilya Sergey wrote:
> Also it would be great, if generated class would have
> name, dependent from initial script file name, but not vanilla "Main".

It looks like you can do this already, with -Xscript:

-Xscript Compile as a script, wrapping the code into object.main()

...but I don't know for sure it's working.

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