Eclipse JavaScript 编辑器:js 文件的内容辅助,自动完成
我正在尝试将 Eclipse(带有 JavaEE 和 Web 开发插件)作为 JavaEE/GoogleAppEngine IDE.在 HTML 编辑器中,如果我将 <script ... src="..."/>
放入 <head>
我会自动获得 JavaScript 的内容辅助引用的文件.我想知道是否可以在 JavaScript 编辑器中获取其他 JavaScript 文件(例如 jQuery 或自制 js 库)的内容辅助.
I'm trying Eclipse (with JavaEE and Web Development plugins) as a JavaEE/GoogleAppEngine IDE. In HTML editor if I put a <script ... src="..." />
in <head>
I automatically get content assist for JavaScript in the referenced file. I was wondering if it was possible to obtain content assist for other JavaScript files (e.g. jQuery or homebrew js library) inside JavaScript editor.
推荐答案
我刚刚想通了如何在Eclipse JavaScript 编辑器(不使用Aptana 插件)中获取js 内容辅助:
I just figured out how to obtain js content assist in Eclipse JavaScript editor (without Aptana plugins):
如果项目类型本身不包含 JavaScript 支持:打开 Web(或 JavaScript)透视图,右键单击项目并选择 Web 开发支持 > 添加 JavaScript 支持(如果 JavaScript 支持已经存在,这不会有什么坏处)
If the project type doesn't natively contain JavaScript Support: open Web (or JavaScript) perspective, right-click on the project and select Web Development Support > Add JavaScript Support (this won't hurt if JavaScript support is already present)
然后在项目中右键单击 JavaScript Support 并选择 Properties,在 JavaScript 部分转到 JavaScript 库,然后选择 Source 选项卡:在这里您可以添加文件夹和当前项目的内容助手要扫描的文件
then right-click JavaScript Support within the project and select Properties, in the JavaScript section go to JavaScript library and then select Source tab: here you can add folders and files to be scanned by content assist for the current project
在 Aptana Studio 中(作为一个 Eclipse 插件,但我想独立版本几乎相同):打开任何 js 或 html 文件,显示 References 窗口(或打开Eclipse 中的 Aptana 透视图)和拖放 js 文件添加到 JavaScript 范围(可以使用不同的 JavaScript 文件和资源构建和激活不同的范围配置文件:只需单击窗口中的 添加配置文件工具栏)
In Aptana Studio (as an eclipse plugin but I suppose the standalone version is almost the same): open any js or html file, show References window (or open Aptana perspective in eclipse) and drag-drop js files you want to add to JavaScript scope (it is possible to build and activate different scope profiles with different JavaScript files and resources: just click add profile in the window toolbar)
相关文章