Spring Tool Suite
  1. Spring Tool Suite
  2. STS-487 As a user, I want to have Grails tooling support in STS
  3. STS-552

Add commands to easily switch between controller,domain, tag library and views for a given convention

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: Sprint 8, 2.3.1.RELEASE
    • Component/s: GRAILS
    • Labels:
      None

      Description

      Since Grails has conventions, and conventions typically group functionality it should be easy to switch between different artefact types using a keyboard shortcut. For example if I have Book.groovy open there should be keyboard shortcuts to switch between BookTagLib, BookController and so on.

        Activity

        Hide
        Andrew Eisenberg (c) added a comment -

        This shouldn't be hard to do. The hardest part will be coming up with the best keyboard command.

        Show
        Andrew Eisenberg (c) added a comment - This shouldn't be hard to do. The hardest part will be coming up with the best keyboard command.
        Hide
        Andrew Eisenberg (c) added a comment -

        A little unsure of the best way to go about this. There are two ways that I can see this command working:

        1. This command works based on the selected editor and allows users to switch between editors.
        2. This command works based on the currently selected element. So, if the current text selection resolves to a Domain class, then the action to navigate to a Controller class is enabled.

        I do think that this command should be available if, for example, a domain class is selected in the package explorer, but in general, the two choices above cannot co-exist.

        I think that the former is the way to go. Any comment?

        Show
        Andrew Eisenberg (c) added a comment - A little unsure of the best way to go about this. There are two ways that I can see this command working: This command works based on the selected editor and allows users to switch between editors. This command works based on the currently selected element. So, if the current text selection resolves to a Domain class, then the action to navigate to a Controller class is enabled. I do think that this command should be available if, for example, a domain class is selected in the package explorer, but in general, the two choices above cannot co-exist. I think that the former is the way to go. Any comment?
        Hide
        Andrew Eisenberg (c) added a comment -

        Done. Mostly. I have created two commands that allow navigating from Domain to controller and back. Keyboard commands and toolbar commands are available.

        The only think I don't like is that I do not have icons for the commands yet. There is text in the toolbar "To Controller" and "To Domain". The actions are only enabled if the current editor is editing a domain class or a controller class respectively.

        Good enough for now. Will be available in next nightly build.

        Show
        Andrew Eisenberg (c) added a comment - Done. Mostly. I have created two commands that allow navigating from Domain to controller and back. Keyboard commands and toolbar commands are available. The only think I don't like is that I do not have icons for the commands yet. There is text in the toolbar "To Controller" and "To Domain". The actions are only enabled if the current editor is editing a domain class or a controller class respectively. Good enough for now. Will be available in next nightly build.
        Hide
        Graeme Rocher added a comment -

        Sorry for the late response. There is still more to be done on this issue IMO. For example if you have:

        class BarController {
            def foo = {}
        }
        

        There should be a "To View" that if BarController is selected it goes to the default action's view (typically index.gsp), but if the closure foo is selected then it goes to grails-app/views/bar/foo.gsp

        There also needs to be "To Service" and "To TagLib". I would suggest implementing this in a similar way to test running in Eclipse. For example you to ALT+CMD+X and then hit for "run" and then hit the type of the thing you want to run ("T" for test for example). It might make sense to have a similar thing and then hit "S" for service "D" for domain "C" for controller and so on.

        Show
        Graeme Rocher added a comment - Sorry for the late response. There is still more to be done on this issue IMO. For example if you have: class BarController { def foo = {} } There should be a "To View" that if BarController is selected it goes to the default action's view (typically index.gsp), but if the closure foo is selected then it goes to grails-app/views/bar/foo.gsp There also needs to be "To Service" and "To TagLib". I would suggest implementing this in a similar way to test running in Eclipse. For example you to ALT+CMD+X and then hit for "run" and then hit the type of the thing you want to run ("T" for test for example). It might make sense to have a similar thing and then hit "S" for service "D" for domain "C" for controller and so on.
        Hide
        Andrew Eisenberg (c) added a comment -

        OK. Looking into this again.

        Show
        Andrew Eisenberg (c) added a comment - OK. Looking into this again.
        Hide
        Andrew Eisenberg (c) added a comment -

        See STS-974. Closing this bug as a duplicate of STS-974.

        Show
        Andrew Eisenberg (c) added a comment - See STS-974 . Closing this bug as a duplicate of STS-974 .

          People

          • Assignee:
            Andrew Eisenberg (c)
            Reporter:
            Graeme Rocher
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: