GGTS: Add to markers instead/in addition to underlined in the editor???

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

GGTS: Add to markers instead/in addition to underlined in the editor???

dalew75
I'm using GGTS 3.1.   I'm doing a lot of refactoring, which can involve moving methods and services from one class to another (Grails project)

It's extremely difficult to catch errors with the refactoring, because it only underlines the missing methods, fields, or injected services in the editor.  Is there any way to get these into the Markers view or something equivalent??  Would give me a lot more confidence!

Screenshot:  I have to visually scan all files to find errors (or just wait until something breaks)Underlined errors in editorUnderlined errors in editor
Dale Wiggins
Architect/Developer
StudentUniverse
Reply | Threaded
Open this post in threaded view
|

Re: GGTS: Add to markers instead/in addition to underlined in the editor???

Octavian Covalschi
That's why your write more tests :) You should not wait till something breaks!

But I know the pain too, although last time I did some simple renaming and STS did a great job. It changed action names in gsp too...

On Fri, Oct 19, 2012 at 10:22 AM, dalew75 <[hidden email]> wrote:
I'm using GGTS 3.1.   I'm doing a lot of refactoring, which can involve
moving methods and services from one class to another (Grails project)

It's extremely difficult to catch errors with the refactoring, because it
only underlines the missing methods, fields, or injected services in the
editor.  Is there any way to get these into the Markers view or something
equivalent??  Would give me a lot more confidence!

Screenshot:  I have to visually scan all files to find errors (or just wait
until something breaks)
<http://grails.1312388.n4.nabble.com/file/n4636762/errors.png>
<http://grails.1312388.n4.nabble.com/file/n4636762/errors.png>



-----
Dale Wiggins
Architect/Developer
StudentUniverse
--
View this message in context: http://grails.1312388.n4.nabble.com/GGTS-Add-to-markers-instead-in-addition-to-underlined-in-the-editor-tp4636762.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: GGTS: Add to markers instead/in addition to underlined in the editor???

dalew75
Fair enough!  :)   I'm doing a lot of moving of methods from one class to another.  
Dale Wiggins
Architect/Developer
StudentUniverse
Reply | Threaded
Open this post in threaded view
|

Re: GGTS: Add to markers instead/in addition to underlined in the editor???

Andrew Eisenberg-2
One thing you can try is to use the "Groovy Type Checking" command.
To use it, select a resource (ie- a project, file or folder)
right-click -> Groovy Type Checking -> Type Check.  This will run the
Groovy-Eclipse inferencing engine on all selected groovy files and add
special markers for anything that can't be resolved (ie- is
underlined).

For some files (like BuildConfig.groovy and other configs), this will
produce a lot of false positives.  So, you can just make sure to avoid
running the type checker on those files.

When you are done, you can run the Groovy Type Checking -> Remove
checks command to remove all markers from those files.

This is a bit of an experimental feature and it would be great to get
some feedback if this is useful.  See more information here
http://groovy.codehaus.org/Groovy-Eclipse+2.5.2+New+and+Noteworthy#Groovy-Eclipse252NewandNoteworthy-Statictypecheckingexperimental

On Mon, Oct 22, 2012 at 12:13 PM, dalew75 <[hidden email]> wrote:

> Fair enough!  :)   I'm doing a lot of moving of methods from one class to
> another.
>
>
>
> -----
> Dale Wiggins
> Architect/Developer
> StudentUniverse
> --
> View this message in context: http://grails.1312388.n4.nabble.com/GGTS-Add-to-markers-instead-in-addition-to-underlined-in-the-editor-tp4636762p4636824.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GGTS: Add to markers instead/in addition to underlined in the editor???

dalew75
Thanks Andrew.   This was exactly what I was looking for!

Even though that generates a LOT of noise (this is with just applying it to services area, where the refactoring was), this helped me find a few issues!  

Most of the noise comes from usage of Maps, where you assign or get values of the map using dot notation....

Example:

Map testMap = [:]
testMap.name = 'Dale' // warning
testMap['name'] = 'Dale'  // OK

Maybe we should start using the more traditional format.  In general as our app has matured, we're being more diligent about explicitly typing things and other 'back to Java' style changes where we can.  Maybe we should do this for Maps, although we're also trying to replace usages of Maps with command objects etc for clarity.

I'll keep using this and let you know how it goes.
Dale Wiggins
Architect/Developer
StudentUniverse
Reply | Threaded
Open this post in threaded view
|

Re: GGTS: Add to markers instead/in addition to underlined in the editor???

Andrew Eisenberg-2
Feedback on this feature would be great.  I tend not to read this
mailing list closely, so if you do have something you want to say,
then raise an issue here:

https://jira.codehaus.org/browse/GRECLIPSE

One of the biggest issues right now is that this is a bit of a hidden
feature.  But I could imagine adding some configuration if people find
this useful (eg- a flag on whether or not to ignore maps, a regex to
define files to ignore, etc.).

On Mon, Oct 22, 2012 at 2:47 PM, dalew75 <[hidden email]> wrote:

> Thanks Andrew.   This was exactly what I was looking for!
>
> Even though that generates a LOT of noise (this is with just applying it to
> services area, where the refactoring was), this helped me find a few issues!
>
> Most of the noise comes from usage of Maps, where you assign or get values
> of the map using dot notation....
>
> Example:
>
> Map testMap = [:]
> testMap.name = 'Dale' // warning
> testMap['name'] = 'Dale'  // OK
>
> Maybe we should start using the more traditional format.  In general as our
> app has matured, we're being more diligent about explicitly typing things
> and other 'back to Java' style changes where we can.  Maybe we should do
> this for Maps, although we're also trying to replace usages of Maps with
> command objects etc for clarity.
>
> I'll keep using this and let you know how it goes.
>
>
>
> -----
> Dale Wiggins
> Architect/Developer
> StudentUniverse
> --
> View this message in context: http://grails.1312388.n4.nabble.com/GGTS-Add-to-markers-instead-in-addition-to-underlined-in-the-editor-tp4636762p4636834.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GGTS: Add to markers instead/in addition to underlined in the editor???

dalew75
Thanks will do.  I'll tell my team about the feature as well.
Dale Wiggins
Architect/Developer
StudentUniverse