Javascript AMD模块:如何跨模块获取Visual Studio智能感知 [英] Javascript AMD Modules: How to get Visual Studio intellisense across modules

查看:103
本文介绍了Javascript AMD模块:如何跨模块获取Visual Studio智能感知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在javascript上下文中查看了异步模块定义(AMD)之后,我想知道如何在Visual Studio 2010中获取从属模块的智能感知.

After looking into Asynchronous Module Definition (AMD) in the javascript context I was wondering how to get intellisense in Visual Studio 2010 for a dependent module.

例如给定的模块A:

define(function() {
    return {
        square: function(value) {
            return value * value;
        }
    };
});

和相应的模块B:

define(["A"], function(a) {
    return {
        value: a.square(10)
    }
});

然后,我想对模块B中的模块A(表示为参数a)具有完整的智能感知.请注意,这两个模块都将在单独的文件中定义(在这种情况下为A.js和B.js).

Then I would like to have full intellisense for the module A (represented as parameter a) within module B. Note that both of these modules would be defined in separate files (A.js and B.js in this case).

推荐答案

RequireJS的作者似乎正在这里进行Intellisense支持: https://github.com/jrburke/requirejs-intellisense

It looks like the author of RequireJS is working on Intellisense support here: https://github.com/jrburke/requirejs-intellisense

不幸的是,我还没有魔术"开始工作.

Unfortunately I haven't gotten the "magic" to work yet.

更新:在某些情况下,我确实做到了这一点.特别是当所有js文件都位于同一文件夹中时,效果很好.

Update: I did get this to work in certain scenarios. In particular it works great when all of the js files are in the same folder.

这篇关于Javascript AMD模块:如何跨模块获取Visual Studio智能感知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆