Freigeben über


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.

Comments

  • Anonymous
    March 02, 2007
    The March CTP of Visual Studio marks the debut of a much-requested and long-awaited feature: improved

  • Anonymous
    March 31, 2007
    I test ORCAS with JavaScript, and really like the type inferencing. Wouldn’t it be possible to have a wrapper prototypes library stereotyping commonly used HTML DOM objects e.g. button, textbox etc to speed JS authoring? Fakher Halim

  • Anonymous
    April 16, 2007
    I came across a couple of great blog posts about details of the JavaScript support we can expect to see

  • Anonymous
    August 01, 2007
    Previous release of Visual Studio "Orcas" debuted the much awaited feature of Javascript intellisense.

  • Anonymous
    January 19, 2008
    Wouldn’t it be possible to have a wrapper prototypes library stereotyping commonly used HTML DOM objects e.g. button, textbox etc to speed JS authoring?