javascript - javascript AMD 加载样式的 IDE 自动完成

标签 javascript ide amd

<分区>

有谁知道可以自动完成 javascript AMD 风格的 IDE :

// my dojoConfig defined aliases to the packages I use (dojo, dmidz)
// so in dmidz/my-module.js
define(['dojo/dom-construct'], function(cons){// requiring some dojo module
   cons.// <- oh it is nicely displaying list of dom-construct module methods
});

请不要只提供您喜欢的最好、最酷的 IDE。我尝试了 Komodo 和 Webstorm,我只是无法让它们工作,或者我没有正确配置它们……但是没有一个可以设置与 dojoConfig 中相同的别名(太难了吗?)。 例如在 Webstorm 中,有一个库的概念,我添加了 dojo 和我的包,但是没办法,当然,不知道别名路径怎么可能。还有一个路径变量的概念,无法理解它是如何工作的,文档太差了!

感谢任何帮助。

最佳答案

您可能正在寻找 TernJS。 It declares support of RequireJS via a plugin

这是我所知道的最适合这项工作的工具。不过,Tern 非常需要 RAM(与纯文本编辑器相比)。 与 Sublime Text 的集成是无缝的,与其他 Sublime 插件一起,您可以使其非常接近 IDE 的定义。

以下是 TernJS 文档的摘录:

Tern is a stand-alone code-analysis engine for JavaScript. It is intended to be used with a code editor plugin to enhance the editor's support for intelligent JavaScript editing. Features provided are:

  • Autocompletion on variables and properties
  • Function argument hints
  • Querying the type of an expression
  • Finding the definition of something
  • Automatic refactoring

Tern is open-source (MIT license), written in JavaScript, and capable of running both on node.js and in the browser. Editor plugins

There is currently Tern support for the following editors:

  • Emacs
  • Vim
  • Sublime Text
  • Brackets (built in to the base editor)

关于javascript - javascript AMD 加载样式的 IDE 自动完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18184207/

相关文章:

c# - 如何根据解决方案更改格式选项

Typescript AMD 模块错误(模块尚未加载上下文)

javascript - 带有日期时间选择器的可编辑数据网格

javascript - 如何使用 Javascript API 在 Excel 中创建数据透视表

sql - 什么是编写 Oracle SQL 的优质开发环境?

java - 自定义 Android Studio 中的创建方法选项

javascript - 不在 RequireJS 环境中时全局公开 AMD 模块

javascript - 无法使用 TypeScript 和 Require.JS 引用对象

javascript - 如何从 javascript xpcom 组件使用 C++ xpcom 组件

javascript - 使用 react 和 node 不使用 req.files 上传图像