简体   繁体   English

eclipse javascript编辑器'10

[英]eclipse javascript editor '10

I am going to ask the same question as JavaScript editor within Eclipse because it was written in 2010 and answers from 2008 are not true any more. 我将在Eclipse中提出与JavaScript编辑器相同的问题,因为它是在2010年编写的,而2008年的答案不再适用。

So, "I'm looking for opinions on the best JavaScript editor available as an Eclipse plugin". 所以,“我正在寻找关于最好的JavaScript编辑器作为Eclipse插件的意见”。

Many thanks. 非常感谢。

You can Install Web Tools Platform (WTP) or download Indigo's Eclipse IDEs for Java EE Developers or Eclipse IDEs for JavaScript Web Developers which come bundled with WTP. 您可以安装Web Tools Platform(WTP)或下载适用于Java EE开发人员的Indigo Eclipse IDE或适用于与WTP捆绑在一起的JavaScript Web开发人员的Eclipse IDE。 WTP consists of the JavaScript Development Tools (JSDT) which supports the development of JavaScript applications and JavaScript within web applications. WTP由JavaScript开发工具(JSDT)组成 ,它支持在Web应用程序中开发JavaScript应用程序和JavaScript。

And since I also use jQuery, I have also installed JSDT-jquery plugin to support jQuery library which can be downloaded form the marketplace JSDT-jquery Plugin 而且由于我也使用jQuery,我还安装了JSDT-jquery插件来支持jQuery库,可以从市场上下载JSDT-jquery插件

This question has been puzzling me for months. 几个月来,这个问题让我困惑不已。

You can use 您可以使用

I am looking for and asked a question about an editor that has all these pretty significant features, but some conservative rep-gatherers found it unfit for stackoverflow. 我正在寻找并询问有关具有所有这些非常重要功能的编辑器的问题 ,但是一些保守的代理人发现它不适合stackoverflow。

I know you asked for Eclipse but VS2010 is far superior for javascript than any other editor I have used. 我知道你要求Eclipse,但VS2010的javascript远远优于我使用过的任何其他编辑器。 It gives contextual autocomplete that digs deeper than I've ever seen anywhere else. 它提供的上下文自动完成功能比我在其他地方所见过的更深入。 The express edition for visual studio web developer 2010 is free by the way. 视觉工作室Web开发人员2010的快递版本是免费的。

I personally don't really like Microsoft but as a javascript editor it just makes me a lot more productive. 我个人并不喜欢微软,但作为一个javascript编辑器,它只会让我更有效率。

example: I once made a (bad) templating solution that transformed javascript objects to DOM elements like this: 示例:我曾经制作了一个(坏的)模板解决方案,将javascript对象转换为DOM元素,如下所示:

var html = { tag: 'div', id: 'myDiv', content: [
  'Hello ',
  { tag: 'span', content: 'world!' }
]}

would transform into 会变成

<div id="myDiv">Hello <span>world!</span></div>

By calling 通过电话

var myDiv = DOM.create(html);

Now I did this by recursively traversing the javascript object and calling for(key in html) . 现在我通过递归遍历javascript对象并调用for(key in html) In there I nested a if(html.hasOwnProperty(key)) . 在那里我嵌套了一个if(html.hasOwnProperty(key)) In there I checked whether key was equal to 'tag' and in that if statement I did the document.createElement(html[key]) . 在那里,我检查了key是否等于'tag' ,在if语句中我做了document.createElement(html[key]) Now I know this is pretty bad code and I am forgetting some steps but that's not the point. 现在我知道这是非常糟糕的代码,我忘记了一些步骤,但这不是重点。

Visual studio was able to autocomplete properties on the myDiv variable for a div element. Visual Studio能够在myDiv变量上为div元素自动完成属性。 Add that the javascript was included from another file than the one I was calling it from. 添加javascript包含在另一个文件中,而不是我从中调用的文件。 You might not be impressed by that but my mind was blown. 你可能不会对此印象深刻,但我的思绪被吹嘘了。

Check following blogposts for more details: 查看以下博客帖子了解更多详情:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM