GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1232

Better content assist for methods with closure arguments

    Details

    • Number of attachments :
      0

      Description

      Currently, applying a content assist proposal for a method that has a closure argument will do something like this:

      myMethodCall null
      

      And the user will have to enter '{', press enter, and then the closure will automatically be terminated with the closing } placed at the correct location.

      We could do better here and do something like this (where '|' is the resulting cursor location):

      myMethodCall {
          |
      }
      

      The difficulty will be twofold:

      1. ensuring that the resulting cursor is placed one indent-level past the indentation of the method call
      2. ensuring that the closing '{' is also placed at the correct indent level.

      Not impossible, but there is currently no mechanism to check this inside of our content assist infrastructure.

        Issue Links

          Activity

          Hide
          Andrew Eisenberg added a comment -

          Closing this bug as a duplicate since the work covered here has been or will be shortly fixed in GRECLIPSE-1262 and GRECLIPSE-1259.

          Now, for closure arguments, null will never be proposed. Instead, an opeening curly brace will be proposed:

          myMethodCall {|
          

          And when the user presses enter, the rest of the closure will be filled in:

          myMethodCall {
              |
          }
          

          Just need to add some testing and will close GRECLIPSE-1259.

          Show
          Andrew Eisenberg added a comment - Closing this bug as a duplicate since the work covered here has been or will be shortly fixed in GRECLIPSE-1262 and GRECLIPSE-1259 . Now, for closure arguments, null will never be proposed. Instead, an opeening curly brace will be proposed: myMethodCall {| And when the user presses enter, the rest of the closure will be filled in: myMethodCall { | } Just need to add some testing and will close GRECLIPSE-1259 .

            People

            • Assignee:
              Andrew Eisenberg
              Reporter:
              Andrew Eisenberg
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: