Eclipse JavaScript 编辑器:js 文件的内容辅助、自动完成 [英] Eclipse JavaScript Editor: content assist for js files, autocompletion

查看:35
本文介绍了Eclipse JavaScript 编辑器:js 文件的内容辅助、自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Eclipse(带有 JavaEE 和 Web 开发插件)作为 JavaEE/GoogleAppEngine IDE.在 HTML 编辑器中,如果我将 <script ... src="..."/> 放在 <head> 中,我会自动获得 JavaScript 的内容帮助引用的文件.我想知道是否可以在 JavaScript 编辑器中获取其他 JavaScript 文件(例如 jQuery 或 homebrew 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 Development Support > Add JavaScript Supportem>(如果 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 透视图)并拖放要添加到 JavaScript 范围的 js 文件(可以使用不同的 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)

这篇关于Eclipse JavaScript 编辑器:js 文件的内容辅助、自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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