getting started on the Eclipse plugin debugger

classic Classic list List threaded Threaded
17 messages Options
12
Reply | Threaded
Open this post in threaded view
|

getting started on the Eclipse plugin debugger

Scott Hickey-3
I have a change working on my own system that enables the Eclipse Java debugger to step through Groovy scripts.

I changed IJavaStratumLineBreakpoints to IJavaLineBreakpoints and set the typeName to
GroovyModel.getCompilationUnit(file).getClasses.get(0).getClass() .

I know this approach is very simplistic but I was wondering if it wouldn't be a good first step to enable some actual debugging and generate some feedback.

When I close and open my workspace, I know that GroovyModel object isn't always populated because the outline view also uses the GroovyModel as well. It seems that th GroovyModel doesn't get refreshed unless I press F5. I haven't really looked into this yet to understand how it works. When the model is present/refreshed, the step debugging works.

I was wondering anyone (Ken, blackdrag)  have any suggestions or thoughts on this?

I also started a new wiki page, http://docs.codehaus.org/display/GROOVY/Eclipse+Plugin+Development,  linked to the Eclipse Plugin wiki page to capture information that would make it easier for people to help with the plugin. I think there are people out there like myself with good programming experience and some limited plugin knowledge that could help with the plugin, but just need to get pointed in the right direction. Does anyone else think building on this wiki page might be helpful?

Scott


New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

Guillaume Laforge
Administrator
Excellent page, Scott! Thanks a lot.
Good pointers for improving the plugin.

I'm off for a few days, but that might be good to apply your patch
soon regarding debugging Groovy in Eclipse.

On 3/29/06, Scott Hickey <[hidden email]> wrote:

> I have a change working on my own system that enables the Eclipse Java
> debugger to step through Groovy scripts.
>
>  I changed IJavaStratumLineBreakpoints to IJavaLineBreakpoints and set the
> typeName to
> GroovyModel.getCompilationUnit(file).getClasses.get(0).getClass()
> .
>
>  I know this approach is very simplistic but I was wondering if it wouldn't
> be a good first step to enable some actual debugging and generate some
> feedback.
>
>  When I close and open my workspace, I know that GroovyModel object isn't
> always populated because the outline view also uses the GroovyModel as well.
> It seems that th GroovyModel doesn't get refreshed unless I press F5. I
> haven't really looked into this yet to understand how it works. When the
> model is present/refreshed, the step debugging works.
>
>  I was wondering anyone (Ken, blackdrag)  have any suggestions or thoughts
> on this?
>
>  I also started a new wiki page,
> http://docs.codehaus.org/display/GROOVY/Eclipse+Plugin+Development,
>  linked to the Eclipse Plugin wiki page to capture information that would
> make it easier for people to help with the plugin. I think there are people
> out there like myself with good programming experience and some limited
> plugin knowledge that could help with the plugin, but just need to get
> pointed in the right direction. Does anyone else think building on this wiki
> page might be helpful?
>
>  Scott
>
>
>  ________________________________
> New Yahoo! Messenger with Voice. Call regular phones from your PC and save
> big.
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

calathus
Hi,
I just started using Groovy Eclipse IDE, but when there is an error, there was no acutual message for the location/reasonof the error. Am I missing some thing?

Regards,
C

On 3/29/06, Guillaume Laforge <[hidden email]> wrote:
Excellent page, Scott! Thanks a lot.
Good pointers for improving the plugin.

I'm off for a few days, but that might be good to apply your patch
soon regarding debugging Groovy in Eclipse.

On 3/29/06, Scott Hickey < [hidden email]> wrote:

> I have a change working on my own system that enables the Eclipse Java
> debugger to step through Groovy scripts.
>
>  I changed IJavaStratumLineBreakpoints to IJavaLineBreakpoints and set the
> typeName to
> GroovyModel.getCompilationUnit(file).getClasses.get(0).getClass()
> .
>
>  I know this approach is very simplistic but I was wondering if it wouldn't
> be a good first step to enable some actual debugging and generate some
> feedback.
>
>  When I close and open my workspace, I know that GroovyModel object isn't
> always populated because the outline view also uses the GroovyModel as well.
> It seems that th GroovyModel doesn't get refreshed unless I press F5. I
> haven't really looked into this yet to understand how it works. When the
> model is present/refreshed, the step debugging works.
>
>  I was wondering anyone (Ken, blackdrag)  have any suggestions or thoughts
> on this?
>
>  I also started a new wiki page,
> http://docs.codehaus.org/display/GROOVY/Eclipse+Plugin+Development ,
>  linked to the Eclipse Plugin wiki page to capture information that would
> make it easier for people to help with the plugin. I think there are people
> out there like myself with good programming experience and some limited
> plugin knowledge that could help with the plugin, but just need to get
> pointed in the right direction. Does anyone else think building on this wiki
> page might be helpful?
>
>  Scott
>
>
>  ________________________________
> New Yahoo! Messenger with Voice. Call regular phones from your PC and save
> big.
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy

Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

Jochen Theodorou
calathus schrieb:
> Hi,
> I just started using Groovy Eclipse IDE, but when there is an error,
> there was no acutual message for the location/reasonof the error. Am I
> missing some thing?

in my plugin, I get the position and an error marker. I get even a hover
from the error marker explaining the error. Additionally the erro is in
the problems view.

So what kind of error was it you ahven't seen? Did you use the eclipse
from cvs?

bye blackdrag
Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

calathus
When I installed Eclipse Groovy IDE to another machine, it showed all feature, so this seems installation problem, thanks for reply.
But I found some strange problems.
1) the compilation behavior difference between ant version of compilation and Eclipse.
a) throw syntax was not detected as error in ant, but in eclipse it was. so this may be depends on some switch of rigorous level or using different compilers?
b) variable name URI was not handled as String even if it is declared as string.( e.g, String URI = "zzzz").
After I changed this to another name, it was handled normally. SO URI seems reserved word in eclipse.

By the way, the installation step of this IDE is rather strange, why not providing simple folder based installation rathar than using pulugin.xml. some how in my third PC, I could not install the IDE using this step..

C

On 3/30/06, Jochen Theodorou <[hidden email]> wrote:
calathus schrieb:
> Hi,
> I just started using Groovy Eclipse IDE, but when there is an error,
> there was no acutual message for the location/reasonof the error. Am I
> missing some thing?

in my plugin, I get the position and an error marker. I get even a hover
from the error marker explaining the error. Additionally the erro is in
the problems view.

So what kind of error was it you ahven't seen? Did you use the eclipse
from cvs?

bye blackdrag

Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

calathus
After I rebooted PC, and started Eclipse, error message problem was disappeared, and now I can use Eclipse IDE on the first PC.
But still the problem a, b remains.(actually b was not compile time problem, at runtime it shows error)

I'll attach simple code and error message it show. this error massage will be shown when I run from eclipse.

class Test1 {
    protected static String URI = "aaa";
      static void main(args) {
            String collection = 'zzz';
        String s1 = URI + collection;
    }
}

--- error
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method java.net.URI.plus () is applicable for argument types: (java.lang.String) values: {"zzz"}
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:486)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java :136)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
    at Test1.main(Unknown Source)

if I change this URI to URI0, it runs successfully.

C


On 3/30/06, calathus <[hidden email]> wrote:
When I installed Eclipse Groovy IDE to another machine, it showed all feature, so this seems installation problem, thanks for reply.
But I found some strange problems.
1) the compilation behavior difference between ant version of compilation and Eclipse.
a) throw syntax was not detected as error in ant, but in eclipse it was. so this may be depends on some switch of rigorous level or using different compilers?
b) variable name URI was not handled as String even if it is declared as string.( e.g, String URI = "zzzz").
After I changed this to another name, it was handled normally. SO URI seems reserved word in eclipse.

By the way, the installation step of this IDE is rather strange, why not providing simple folder based installation rathar than using pulugin.xml. some how in my third PC, I could not install the IDE using this step..

C


On 3/30/06, Jochen Theodorou <[hidden email]> wrote:
calathus schrieb:
> Hi,
> I just started using Groovy Eclipse IDE, but when there is an error,
> there was no acutual message for the location/reasonof the error. Am I
> missing some thing?

in my plugin, I get the position and an error marker. I get even a hover
from the error marker explaining the error. Additionally the erro is in
the problems view.

So what kind of error was it you ahven't seen? Did you use the eclipse
from cvs?

bye blackdrag


Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

Jochen Theodorou
calathus schrieb:
[...]

> class Test1 {
>     protected static String URI = "aaa";
>       static void main(args) {
>             String collection = 'zzz';
>         String s1 = URI + collection;
>     }
> }
>
> --- error
> Exception in thread "main" groovy.lang.MissingMethodException: No
> signature of method java.net.URI.plus () is applicable for argument
> types: (java.lang.String) values: {"zzz"}

looks like URI was resolved to the class java.net.URI... you are really
using jsr-5?

bye blackdrag
Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

Jochen Theodorou
In reply to this post by calathus
calathus schrieb:
> When I installed Eclipse Groovy IDE to another machine, it showed all
> feature, so this seems installation problem, thanks for reply.

good to know.

> But I found some strange problems.
> 1) the compilation behavior difference between ant version of
> compilation and Eclipse.

> a) throw syntax was not detected as error in ant, but in eclipse it was.
> so this may be depends on some switch of rigorous level or using
> different compilers?

it was? like what? can you give an example and the message?

> b) variable name URI was not handled as String even if it is declared as
> string.( e.g, String URI = "zzzz").
> After I changed this to another name, it was handled normally. SO URI
> seems reserved word in eclipse.

see other mail.

> By the way, the installation step of this IDE is rather strange, why not
> providing simple folder based installation rathar than using
> pulugin.xml. some how in my third PC, I could not install the IDE using
> this step..

I would like to provide an update site for the plugin.. but these are
plans. I really wish I would understand the internals as good as the
internals of groovy. Maybe I should buy a book ;)

bye blackdrag
Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

calathus

> But I found some strange problems.
> 1) the compilation behavior difference between ant version of
> compilation and Eclipse.

> a) throw syntax was not detected as error in ant, but in eclipse it was.
> so this may be depends on some switch of rigorous level or using
> different compilers?

it was? like what? can you give an example and the message?

following code can be compiled on groovyc(ant), but not in eclipse.
class Test1 {
    protected static String URI = "aaa";
   void f() throws Exception {}
      static void main(args) {
            String collection = 'zzz';
        String s1 = URI + collection;
        System.out.println(">> "+s1);
    }
}

I tested on groovy-all-1.0-jsr-05.jar, but the result was the same.
(I was using the latest groovy build)


> b) variable name URI was not handled as String even if it is declared as
> string.( e.g, String URI = "zzzz").
> After I changed this to another name, it was handled normally. SO URI
> seems reserved word in eclipse.


This problem also confirmed on groovy-all-1.0-jsr-05.jar.
Although strange, but not so serious issue.
But overall, scoping seems have a problem..

C
Reply | Threaded
Open this post in threaded view
|

Re: getting started on the Eclipse plugin debugger

Scott Hickey-3
I just tested it with my version of the Eclipse plugin and I was able to run it. I am using a RC1-snapshot though.

Scott

calathus <[hidden email]> wrote:

> But I found some strange problems.
> 1) the compilation behavior difference between ant version of
> compilation and Eclipse.

> a) throw syntax was not detected as error in ant, but in eclipse it was.
> so this may be depends on some switch of rigorous level or using
> different compilers?

it was? like what? can you give an example and the message?

following code can be compiled on groovyc(ant), but not in eclipse.
class Test1 {
    protected static String URI = "aaa";
   void f() throws Exception {}
      static void main(args) {
            String collection = 'zzz';
        String s1 = URI + collection;
        System.out.println(">> "+s1);
    }
}

I tested on groovy-all-1.0-jsr-05.jar, but the result was the same.
(I was using the latest groovy build)


> b) variable name URI was not handled as String even if it is declared as
> string.( e.g, String URI = "zzzz").
> After I changed this to another name, it was handled normally. SO URI
> seems reserved word in eclipse.


This problem also confirmed on groovy-all-1.0-jsr-05.jar.
Although strange, but not so serious issue.
But overall, scoping seems have a problem..

C



Scott


New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.
12