是否有一个 Eclipse 插件可以为“javascript 显示模块模式"创建大纲视图?
我喜欢 eclipse,经过一些调整,它可以用于 javascript 编程.有语法补全、linting、格式化,还有大纲",尽管只适用于简单的 javascript 文件.
I like eclipse, and with some tweaking it can be used for javascript programming. There's syntax completion, linting, formatting, and there's "outlining", albeit only for simple javascript files.
让我烦恼的是,对于遵循显示模块"设计模式的文件没有大纲视图".这恰好是我最喜欢的编码风格.
What annoys me is that there is no "Outline View" for files that follow the "revealing module" design pattern. This happens to be my favorite coding style.
是否有某个插件可以在 Eclipse 中添加一个扩展"大纲视图,该视图能够查看内部"以显示模块样式"编写的 .js 文件的嵌套结构,显示封装的私有函数和成员?(对于这种样式,正常的eclipse 大纲视图通常是空的).
Is there a plugin somewhere that adds to Eclipse an "extended" outline view that is able to "see inside" the nested structure of a .js file written in the "revealing module style", showing the encapsulated private functions and members? (The normal "eclipse outline view is usually empty for this type of style).
推荐答案
再次回答我自己的问题:
Answering my own question, again:
IIFE内部的javascript函数必须用JSDoc风格注解,然后才会出现在大纲视图中.
The javascript functions inside the IIFE must be annotated in the JSDoc style, then they will appear in the outline view.
这里描述了整个过程,并附有截图:
The whole process is described here, with screenshots:
http://www.kajabity.com/2012/02/how-i-introduced-jsdoc-into-a-javascript-project-and-found-my-eclipse-outline/
相关文章