Page 1 of 1

Content assist doesn't work within an anonymous function

Posted: Sun Dec 07, 2008 12:23 pm
by Huck Finn
Content assist doesn't work within a body of an anonymous function when the function is passed as a non-first parameter to another function.

Consider the following example:

Code: Select all

/**
 * @class
 */
function Foo() {
    /**
     * @return {Object}
     */
    this.bar = function() {
        return {};
    };
}

function f1(/*Function*/f) {
    //
}

function f2(/*String*/s, /*Function*/f) {
    //
}

function f3(/*Function*/f, /*String*/s) {
    //
}

f1(function(/*Foo*/foo) {
       // code completion for foo works here
   });

f2('', function(/*Foo*/foo) {
       // !!! code completion for foo *DOESN'T* work here
   });

f3(function(/*Foo*/foo) {
       // code completion for foo works here
   }, '');
Neither foo nor foo's bar is shown in the pop-up list of choices when I type `f` or `foo.b` then Ctrl+Space in the position marked with `!!!`.