Visual Studio 中的 HTML5 Javascript API Intellisense 支持

Visual Studio 中的 HTML5 Javascript API Intellisense 支持

问题描述:

我开始玩 HTML5/CSS3 和新的 JavaScript API

I started playing with HTML5/CSS3 and the new JavaScript API

我在 VS 2010 中注意到的一点是它不支持新的 JavaScript API 我想知道是否有什么我可以做的

something i noticed in VS 2010 is it doesn't have any support for the new JavaScript API i was wondering if there is anything i can do about it

所以在 Vs2010 中,如果我输入:

so in Vs2010 if i type :

     var canvas = document.getElementById('diagonal');
     var context = canvas.getContext('2d');

我对getContext"方法等没有任何智能感知.

i don't get any intellisense for the "getContext" method etc..

我不想编写代码并编译并祈祷它起作用.

i dont wanna write the code and compile and pray it works.

知道如何为新的 javascript 启用智能感知吗?

any idea how can i enable intellisense for new javascript ?

我知道你标记了 VS2010,但是 Visual Studio 11 开发者预览版,大概是最终的 RTM,原生支持 HTML5 智能感知,包括对画布的支持.

I know you tagged VS2010, but the Visual Studio 11 Developer Preview, and presumably the eventual RTM, natively supports HTML5 intellisense, including support for canvas.

针对 DOM API 的 IntelliSense 已得到改进,支持许多新的HTML5 API,包括 querySelector、DOM Storage、跨文档消息传递和画布.DOM IntelliSense 现在由单个驱动简单的 JavaScript 文件,而不是本机类型库定义.这使得扩展或更换变得容易.

IntelliSense for DOM APIs has been improved, with support for many new HTML5 APIs including querySelector, DOM Storage, cross-document messaging, and canvas. DOM IntelliSense is now driven by a single simple JavaScript file, rather than by a native type library definition. This makes it easy to extend or replace.