Forum Discussion
Hi Saravana,
That combo box lists top-level functions only (those defined in the global context of a unit). You can submit an enhancement request here. There's also an existing feature request to add code completion for class methods.
Thank you. I will add this in the new feature thread.
Just noticed that even prototype function (JavaScript Project) as well not populated under the Routines list. JScript project prototype functions are listed.
Regards,
Saravana
- tristaanogre8 years agoEsteemed Contributor
Can you give an example of a prototype function in a JScript project that is showing in the drop down? I just did the following:
function testme() { function blah() { Log.Message('blah'); } this.me; this.who; this.whatever = function (){ Log.Message('what'); } }
And, as expected, only "testme" shows up in the drop down as that is a function that is declared globally on the unit.
- SaravanaKumar_N8 years agoContributor
- tristaanogre8 years agoEsteemed Contributor
Gotcha. Yep, seeing that.
Now, HKosova probably can give a more official response but, as I understand it, the routine drop down at the top of a script edit window is intended within the context of developing test cases as script. Each "routine" is, potentially, a test case and the idea is to give easy access to select such a test case and then click the "Run Current Routine" button.While in a full JavaScript IDE, those methods are "routines", they are not test cases or methods that can be run in such a manner... you need to instantiate the object and then run the routine. So, in the context of what TestComplete provides, this doesn't feel to me like it makes sense. That said, not sure why it works in JScript but not in JavaScript but, basically, that's how I experience it. I look forward to seeing the feature request as there might be some cool aspects about it concerning turning TC into something more of a full IDE.
Now, to your question about intellisense, etc... Creating classes and such and then having them available in what TC calls "code completion" would be cool. But keep in mind that, effectively, each script unit is being treated in the same way that a page is treated when using JavaScript for web development. You cannot call a routine or method or property of an object instantiated in a different web page unless you first import it into the web page or otherwise pass it through. So, in that line, TC is following that model. If you want an object to be available in Code completion, that object needs to be built in, somehow, to the environment either as a plugin or a Script Extension.
Related Content
Recent Discussions
- 19 hours agodhundley