Key F12 to jump to function not working in some cases

6 posts, 0 answers
  1. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 17 Feb 2014 Link to this post

    You have to options on how to define a function:

    Option 1:
    function fancy_function() {
        // Fancy stuff happening here
    }


    Option 2:
    var fancy_function = function() {
        // Fancy stuff happening here, too.
    }

    Both are accepted ways of defining a function.

    The F12 key (at least in AppBuilder) lets you jump to a function if the cursor is located on a that specific function call. However, if your function is defined as in option 2, this does not work. Since the 2nd option has some advantages over option 1, I am using it a lot. 

    Could you please make the F12 key be able to jump to functions that are defined as in option 2?
  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 19 Feb 2014 Link to this post

    Hi Jan-Dirk,

    Thanks for your feedback.
    I tried to reproduce your issue, but without avail.
    The navigation is working properly and in case you have both declarations they are both shown.

    Can you provide us a sample where this is reproducible or some hints?

    I look forward to hearing from you.

    Regards,
    Zdravko
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  3. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 19 Feb 2014 in reply to Zdravko Link to this post

    Hello Zdravko,

    Thank you for getting back to me.

    Feel free to check it with my app 'Assets to EAM'. Open up 'app.js' and 'database.js' in the 'js'-folder.

    In 'app.js' you will find on line 11 a call to initDatabase. Position the cursor somewhere on the word 'initDatabase' and press the F12-key. In the status bar on the bottom of AppBuilder I now see a message "definitions of 'initDatabase' not found".
  4. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 19 Feb 2014 in reply to Jan-Dirk Link to this post

    ... continued...

    In 'database.js' you will see that I have declared function initDatabase as follows:

    initDatabase = function()

    Now (feel free to) change it to

    function initDatabase()

    Go back to 'app.js', position the cursor on the word initDatabase and press the F12-key again. Now you will jump to 'database.js' and the cursor will be on the first line of that function.


  5. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 24 Feb 2014 Link to this post

    Hello Jan-Dirk,

    Thanks for the provided project.
    Thanks to it I was able to find the culprit for this issue. As you can see in your database.js file there is no var keyword in front of the initDatabase declaration. Once you add it the navigation will work as expected.

    var initDatabase = function() {}

    I hope I've been of assistance.


    Regards,
    Zdravko
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  6. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 24 Feb 2014 in reply to Zdravko Link to this post

    Ah... I am very sorry about that. Thank you very much for pointing that out, I think I never used a var in front of a declaration like this.
Back to Top