Welcome to MSDN Blogs Sign in | Join | Help

Visual Web Developer Team Blog

Your official information source from the Visual Web Developer team.

News

  • These postings are provided "AS IS" with no warranties, and confer no rights. Use of included code samples are subject to the terms specified Terms of Use
JScript IntelliSense: Working with Ext JS

Ext is great framework for adding rich AJAX interactivity to your web application.  Unfortunately, JScript IntelliSense currently has difficulties processing the script and it's not uncommon to see this message:

Ext

I just wanted to let everyone know that we've investigated and fixed the issue.  This fix will be available in the next service pack (no date announced yet).  In the meanwhile, there's actually a simple workaround.  In a file that runs before ext-base.js, or on the first-line of ext-base.js itself, add the following code:

window.addEventListener = false;

This corrects for an inaccuracy in our simulated execution environment.  Once again, after the next service pack, this workaround will no longer be neccesary.  I quickly experimented with Ext 2.0.2...

ext20

...and Ext 1.1.1...

ext11

Ext is one of the larger libraries out there and thus it takes longer to execute.  If you've been seeing...

Timeout

...increasing the timeout will often solve the problem.

Increasing the Timeout

By default, every IntelliSense request is only allowed 15s to execute.  This is to prevent IntelliSense from scripts with infinite loops.  If you have a large script or slower machine, it may make sense to increase the timeout limit.  The timeout value store within following registry keys (depending on if your are using Express or the full product).  The value is in milliseconds so choose something greater than 15000.

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\HTML Editor\JsFailsafeTimeout 
HKEY_CURRENT_USER\Software\Microsoft\VWDExpress\9.0\HTML Editor\JsFailsafeTimeout

On a related note, we've read all the requests for Prototype support.  Like Ext, We've fixed the issue for the next service pack. But unlike Ext, there isn't a temporary workaround to be offered.  We hope this info unblocks your work.  Thanks for using our editor!

Jeff King
Program Manager
Visual Studio Web Tools

Posted: Wednesday, March 12, 2008 5:00 PM by WebDevTools

Comments

Brock said:

Any possibility of JavaScript intellisense honoring the ///<returns domElement='true'> for return values or ///<param domElement='true'> inside of functions? TIA

# March 12, 2008 11:13 PM

tgmdbm said:

Great news.

Keep up the good work.

# March 13, 2008 8:05 AM

Kevin Dente said:

Great news - glad you're continuing to improve things. How about improved YUI support? I had problems with namespaces.

# March 13, 2008 12:19 PM

WebDevTools said:

@Brock: We'll definitely consider respecting domElement=true.

# March 13, 2008 2:44 PM

WebDevTools said:

@Kevin Dente: We've tested about 10 of the core YUI library files and so far they've seemed to be working.  I realize it's not a conclusive testing strategy, so if you have a sample app where YUI IntelliSense is not working, please feel free to send it to me (jking-at-microsoft-dot-com) and we can take a look.  Thanks!

# March 13, 2008 2:47 PM

mike kidder said:

Excellent... keep up the great work guys and keep posting :)

# March 13, 2008 3:24 PM

ScottGu's Blog said:

I'm slowly recovering from keynoting at MIX last week, and have been digging my way out of backlogged

# March 14, 2008 3:06 AM

BusinessRx Reading List said:

I'm slowly recovering from keynoting at MIX last week, and have been digging my way out of backlogged

# March 14, 2008 3:28 AM

Mirrored Blogs said:

I&#39;m slowly recovering from keynoting at MIX last week, and have been digging my way out of backlogged

# March 14, 2008 4:06 AM

Custa said:

Is there any plans to bring Mootools into VS2008?

# March 14, 2008 9:48 AM

geoffrey.mcgill said:

Awesome find. [high-five!]

I've been testing this workaround all morning and thought I would post my results here...

1. As you noted the fix MUST be added to an external .js file. Adding the line of code to an inline &lt;script&gt; block which is rendered above the external Ext script includes does not appear to work.

2. The "window.addEventListener = false;" appears to disable events from attaching in FireFox and Safari. The page appears to render correctly, but all events are disabled. Maybe this should be a VS Design-Time only fix?

3. We add the Ext files to our Assembly as Embedded Resources and have yet to get the addEventListener fix to work with these Embedded Resources. We're running a  few tests to figure out exactly why. I thought it had something to do with not adding the scripts to the document head, but...

4. The fix and Ext scripts do not need to be included in the head of the page. The fix just needs to be included before the Ext includes.

Probably point #2 is the most serious limitation. Wrapping the line in an IE only browser/dom check would easily solve the problem, although completely removing the fix at render/release would certainly be safer.

# March 14, 2008 1:01 PM

geoffrey.mcgill said:

forgot to add...

5. We do find it takes a while (10-30 seconds) until Ext shows up in intellisense the first time the page loads in VS, BUT ONLY if the 2008 Hot Fix Roll up has NOT been installed. With the hot fix, Ext pops into intellisense almost immediately. The registry edits were not required.

Get the Visual Studio 2008 Hot Fix at the following location:

http://weblogs.asp.net/scottgu/archive/2008/02/08/vs-2008-web-development-hot-fix-roll-up-available.aspx

# March 14, 2008 1:32 PM

WebDevTools said:

@geoffrey.mcgill:  Thanks for the detailed feedback!  Some answers:

1. Correct, this workaround will not work for an inline script block.  The code always need to be in another file relative to your active document.

2. Correct, this should only be a design-time only fix.  Perhaps I should have made that more clear.

3. Your scenario should work.  Let us know if for some reason it doesn't.

4. Correct, any line of code that executes before Ext will do.

5. That sounds great!  What type of box do you have?  On mine, it takes about 10 seconds (with the hotfix).

# March 14, 2008 2:13 PM

Kevin Cornwell said:

This is why VS is the best IDE in the world.  Keep up the good work.

# March 15, 2008 11:54 AM

IliaJ on .NET said:

Visual Studio 2008 JavaScript IntelliSense and Ext JS Framework

# March 15, 2008 8:10 PM

Dflying Chen said:

摘要本期共有7篇文章(实际上有12篇文章,这两天不知为何网络状况一直不好,很多国外网站都上不去,只好暂时作罢):深入ASP.NETAJAX:对象继承体系使用ASP.NET3.5和自定义层...

# March 16, 2008 9:43 AM

Jacky_Xu said:

摘要本期共有7篇文章(实际上有12篇文章,这两天不知为何网络状况一直不好,很多国外网站都上不去,只好暂时作罢):深入ASP.NETAJAX:对象继承体系使用ASP.NET3.5和自定义层级数...

# March 16, 2008 9:52 PM

Wayne Douglas said:

This also seems to only work when using the Ext-base and not one of the adapters such as JQuery.

Great work though - it was like christmas had come - seeing that 'Ext' popup in my intellisense!!!

w://

# March 19, 2008 4:39 AM

WebDevTools said:

@Wayne: Out of curiosity, are you using Ext1 or Ext2?

# April 1, 2008 6:00 PM

mike kidder said:

Hey geoffrey, thanks for your feedback as well..

# April 1, 2008 8:33 PM

beckenov said:

I have use all reccomendations given here. But I have such error.

Error updating JScript IntelliSense: Client-side script IntelliSense information was not generated due to an error in an external script reference.

I tested with ExtJs 2.0.2 and ExtJs 2.1. Everywhere is same error.

Please help.

# April 25, 2008 3:46 AM

beckenov said:

I have used all reccomendations given here. But I have such error.

Error updating JScript IntelliSense: Client-side script IntelliSense information was not generated due to an error in an external script reference.

I tested with ExtJs 2.0.2 and ExtJs 2.1. Everywhere is same error.

Please help.

# April 25, 2008 3:46 AM

WebDevTools said:

@beckenov:  Could you provide me with a sample of the project you are experiencing the error with?  My email is (jking-at-microsoft-dot-com).  Thanks!

# April 25, 2008 1:26 PM

Richard said:

I have the same problem as beckenov.

If I download the latest ExtJS 2.1 and create a new site. Then add a Extjs folder and copy in the ExtJS files and then add a new js file and add the following:

/// <reference Path="../Javascript/ext-shim.js"

/// <reference Path="../Extjs/adapter/ext/ext-base.js"/>

/// <reference path="../Extjs/ext-all-debug.js"/>

If I remove ext-all-debug.js then no error (same error with ext-all.js)

# May 9, 2008 3:38 AM

Richard said:

Problem was caused by having the <reference name="MicrosoftAjax.js"/> reference in. So no debugging both!!

# May 9, 2008 5:59 AM

Your Websites, Our Passion! said:

Visual Studio 2008 SP1 Beta is now available! You can download it here . In SP1, we have added some new

# May 12, 2008 12:08 PM

WebDevTools said:

@Richard: I'm able to use MicrosoftAjax.js + ext-base.js + ext-all-debug.js and IntelliSense is working.  I realize I'm on a VS2008 SP1 Beta build (so I don't need the shim).  If you plan on trying out the beta, let me know if it fixes it for you.  If you don't plan on trying the beta, let me know and we can further diagnose.  Thanks!

# May 12, 2008 4:34 PM

EShy said:

I just installed SP1 beta, no extjs intellisense.

with the shim, intellisense works, but when I remove it I get the following error

Warning 1

Error updating JScript IntelliSense: C:\Users\EShy\Documents\Visual Studio 2008\Projects\ExtJS2\ExtJS2\Ext\adapter\ext\ext-base.js: Object doesn't support this property or method @ 9:7311

C:\Users\EShy\Documents\Visual Studio 2008\Projects\ExtJS2\ExtJS2\js\application.js 1 1 ExtJS2

this is with Ext 2.1 (using the VS2008 project template from the extjs forums)

what could be the problem?

# May 19, 2008 10:59 AM
New Comments to this post are disabled
Page view tracker