GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1114

Code completion not working inside inline closure invocation

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.1Release
    • Fix Version/s: 2.6.0.Release
    • Component/s: Content Assist
    • Labels:
      None
    • Environment:
      Eclipse 3.7
    • Number of attachments :
      0

      Description

      The following will not suggest foo:

      (1..10).each { 
          // foo() not suggested
      }
      
      def foo() {
          
      }
      

      however, this will:

      def bar = { 
          // foo() suggested
      }
      
      def foo() {
          
      }
      

        Activity

        Hide
        Andrew Eisenberg added a comment -

        The problem here is a confusion with the type of this. Inside the each closure, this is inferred to be of type Integer, but inside the field initializer closure, this is inferred to be the type of the script.

        Although that is technically correct, the delegate methods in the each closure (which come from the script) should be available too in content assist.

        Show
        Andrew Eisenberg added a comment - The problem here is a confusion with the type of this . Inside the each closure, this is inferred to be of type Integer , but inside the field initializer closure, this is inferred to be the type of the script. Although that is technically correct, the delegate methods in the each closure (which come from the script) should be available too in content assist.
        Hide
        Andrew Eisenberg added a comment -

        Fixed and committed with regression tests.

        Show
        Andrew Eisenberg added a comment - Fixed and committed with regression tests.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Bob Tiernay
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: