Forum Discussion

paul_grizzaffi's avatar
paul_grizzaffi
Occasional Contributor
12 years ago

Code Completion for User-Defined Objects

Hello,

When I have a user-defined JScript object in my test script (or in an external file that’s accessed via USEUNIT), I can’t figure out how to get code completion and “go to declaration” to work on methods defined on that object.

 

For example, consider the following code:

 

var MyObject = {

  method1: function (){

  }

}

 

function function1() {

 

}

 

function main() {

  function1();

  MyObject.method1();

}

 

Code completion (ctrl-space) will complete the function name function1, but will not complete the name method1. Also, ctrl-click on the call to function1 will take me to the declaration of function1, but will not take me to the declaration of method1.

 

Is there a way to cause this to work? My apologies if there’s already a topic on this, but I couldn’t find it.

 

Thanks!

Paul

2 Replies

  • Hi Paul, unfortuately this cannot be done as the Test Complete JScript Parser simply cannot do it, as per the official response in this thread




    Regards,


    Phil Baird

  • paul_grizzaffi's avatar
    paul_grizzaffi
    Occasional Contributor
    That's unfortunate. I'm going to respond to the link you provided to get another +1 on the feature.



    Thanks for your quick response!

    Paul