Aptana Studio
  1. Aptana Studio
  2. APSTUD-902

[JS] CA doesn't work for variables passed as parameter in anonymous functions

    Details

      Description

      1. Create a new Web Project
      2. Create a new empty JS file
      3. Select Commands->jQuery->Edit this bundle. This will create a new jQuery project in your workspace
      4. Open the new jQuery project
      5. Expand the support directory
      6. Copy-drag the jquery.1.4.2.sdocml file from the support directory into the project you created initially
      7. Place the following content in your JS file
        (function($) {</p>
          $().|
        })(jQuery);
        
      8. Place your cursor where the '|' is in the JS file
      9. Force content assist

      It is expected that you will see a number of entries coming from jQuery, including add, addClass, after, etc.

        Activity

        Hide
        Kevin Lindsey added a comment -
        {html}<div><p>This is not being handled by the inferencing engine yet. Until
        then, you can add an sdoc comment above this construct to declare
        the type of $</p>
        <pre>
        <code>/**
        * @param {jQuery} $
        */
        (function($) { ... })(jQuery)</code>
        </pre></div>{html}
        Show
        Kevin Lindsey added a comment - {html}<div><p>This is not being handled by the inferencing engine yet. Until then, you can add an sdoc comment above this construct to declare the type of $</p> <pre> <code>/** * @param {jQuery} $ */ (function($) { ... })(jQuery)</code> </pre></div>{html}
        Hide
        snop added a comment -
        {html}<div><p>OK, thank you</p></div>{html}
        Show
        snop added a comment - {html}<div><p>OK, thank you</p></div>{html}
        Hide
        Kevin Lindsey added a comment -
        {html}<div><p>We now associate argument values with each parameter so we can
        infer the parameter type based on those values. I verified with the
        original snippet that the sdoc comment is no longer needed.</p></div>{html}
        Show
        Kevin Lindsey added a comment - {html}<div><p>We now associate argument values with each parameter so we can infer the parameter type based on those values. I verified with the original snippet that the sdoc comment is no longer needed.</p></div>{html}
        Hide
        Joel Witt (Inactive) added a comment -

        Aptana Studio 3, build: 3.0.6.201110121628
        Ubuntu 11.04

        Verification process :

        • Performed Description sequence, verified content assist displays expected snippets.
        Show
        Joel Witt (Inactive) added a comment - Aptana Studio 3, build: 3.0.6.201110121628 Ubuntu 11.04 Verification process : Performed Description sequence, verified content assist displays expected snippets.

          People

          • Assignee:
            Kevin Lindsey
            Reporter:
            snop
          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development