Watch out for JScript Authoring Support in Visual Studio "Orcas" - Part I

Hello, I am Sameer Chabungbam.  For living, I work as a Program Manager in the JScript team at Microsoft.  This team, among other things, has been working for sometime now to incorporate a good design time support for the JScript language in Visual Studio Orcas release.  I would be writing about what we have been doing for the last few months.  This is the first, and here, I would talk about Intellisense.

Enhanced Intellisense for JScript

Up until now, Intellisense support for Jscript in Visual Studio has been very limited.  With the Orcas release, Visual Studio would provide smarter and better intellisense.  These include:

  • Expanded Global list
  • Inferencing
  • Script References

Global List has been expanded to include keywords and local variables.  The list would also take care of providing the right scoping.  That is, it would present only the symbols which are present in the current scope.

Inferencing

The best feature, in my opinion, about the new Intellisense support is that we have a lot smarter intellisense.  It is now able to infer the correct types in many scenarios.  Consider the following examples.

An example of inference through assignments:

     var d1, d2, d3;

    d1 = new Date();
    exec_task();
    d2 = new Date();

    d3 = d2 - d1;
    d3.

At this point, intellisense completion list would correctly contain the members of a number.

Here is an example of inference through function return values:

     function compute_time(exec_task)
    {
        var d1, d2, d3;

        d1 = new Date();
        exec_task();
        d2 = new Date();

        d3 = d2 - d1;
        return d3;
    }

    compute_time(myfunc).

Again, here, we get a smarter intellisense for number.  There are many scenarios in which we get better intellisense.  Do download the next CTP release of Visual Studio and check out this new intellisense for JScript.

In the next part, I would write about the Intellisense through Script references.