Forum Discussion

Antonio_Haynes's avatar
Antonio_Haynes
Contributor
11 years ago

Add summary for JavaScript functions to intellisense

Hello,

 Im new to test complete and javascript, Im wondering if there is any way that I can add a summary to my custom functions in javascript so that when im trying to use the intellisense I get a discription of what that function does.

  • Hi Antonio, unfortunately there is no way to add summary information to you JScript functions if they are within a Script Unit.


     


    The only case where it can be done is if the functions appear in a Script Extension. via the Description.xml file.




    This unfortuately has the drawback in that Script Extensions cannot access external code via //USEUNIT, they are required to be completely self contained.





    If your functions belong to a user defined object, e.g. myFunction() in the following module MyModule


     


    var MyModule(function(){


      return {


        myFunction: function() {


          return 123;


        }


      };


    })();


     


    then there is no way to get the function myFunction() to appear in the intellisense at all.


     


    Regards,


    Phil Baird





  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi Antonio, unfortunately there is no way to add summary information to you JScript functions if they are within a Script Unit.


     


    The only case where it can be done is if the functions appear in a Script Extension. via the Description.xml file.




    This unfortuately has the drawback in that Script Extensions cannot access external code via //USEUNIT, they are required to be completely self contained.





    If your functions belong to a user defined object, e.g. myFunction() in the following module MyModule


     


    var MyModule(function(){


      return {


        myFunction: function() {


          return 123;


        }


      };


    })();


     


    then there is no way to get the function myFunction() to appear in the intellisense at all.


     


    Regards,


    Phil Baird





  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    I'd also like to know how to do this or if it's even possible.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi,


     


    I'd like to add that we have the corresponding suggestion in our DB - I've added your votes to it.


     

  • As an added note, I have looked for this topic on the smartbear help pages and from google, with no luck .
  • That is unfortunate, I was really hoping to be able to use that kind of functionallity. Thanks for the reply. it is nice to know that I cannot at least.