DevExpress 在 Javascript 重构方面取得了多大进展?
一年多前,我记得看到一位 DevExpress 布道者在 Visual Studio shell 中预览或至少推广丰富的 Javascript 重构(不仅仅是有限的智能感知),我记得 CodeRush/DevExpress 产品线的一部分。我很兴奋。
今天检查(lmgtfy)时,我只能找到非常非常有限的参考,只有产品描述中关于测试版的一小段斜线,没有视频,没有博客文章,没有社区嗡嗡声。是不是掉下来了?蒸汽件?执行不力,他们甚至不提倡?
Javascript 可以说是有史以来最流行的编程语言,并且在过去 10 年里几乎每台机器上都有一个虚拟机,为什么编辑器支持这么差? (与 Java 和 C# 相比)?您会看到 ScottGu 之类的人吹嘘我们现在有了 jQuery 智能感知,但与 IDE 中丰富的 C# 支持相比,这就是一个笑话。
有人曾经说过,由于 Javascript 的编写风格有很多种,因此构建一个具有重构支持的丰富 IDE(超越智能感知)是很困难的,但如果多个引擎可以解释/编译 JS 并得到相同的结果,那么肯定很难分析它以支持重命名变量之类的东西,提取方法,移动到另一个命名空间(或其 JS 迷你),等等。我错了吗?
Over a year ago, I remember watching one of DevExpress evangelists previewing or at least promoting rich Javascript refactoring (beyond just limited intellisense) within the Visual Studio shell, I recall part of CodeRush/DevExpress product line. I was excited.
On checking today (lmgtfy) I can find only very very limited reference to it, just one small italtic line about beta in product description, no videos, no blog posts, no community buzz. Was it dropped? Vapourware? Poor implementation that they dont even promote it?
With Javascript arguably the most popular programming language ever and with a VM for it on practically every machine in last 10 years, why is editor support so poor? (Compared with those for Java and C#)? You see the likes of ScottGu bragging we now have jQuery intellisense but compare this to richness of C# support in the IDE it is a joke.
Someone once said since there are many style of writing Javascript a rich IDE (beyond intellisense) with refactoring support is difficult, but if several engines can interpret/compile JS with same result surely it should be hard to analysis it to support stuff like rename variable, extract method, move to another namespace (or JS minic of it), etc.. Am I wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
CodeRush 支持 52 种 JavaScript 重构:
以及八个先消费声明和快速修复功能:
此外,我们正在努力改进对 10.2 版本的重构支持。我们最近还改进了快速导航,使导航到 JavaScript 函数就像在 C# 或 VB 中导航一样简单。这项改进将在 10.2 中发布,但现在 CodeRush 客户可以在日常构建中使用。
全面披露——我领导 DevExpress 的 CodeRush 团队。
CodeRush supports fifty-two JavaScript refactorings:
And eight consume-first declaration and quick fix features:
Also, we're working to improve our refactoring support for the 10.2 release. We've also recently improved Quick Nav to make navigating to JavaScript functions as easy as navigation in C# or VB. This improvement will ship in 10.2 but is available now for CodeRush customers in a daily build.
Full Disclosure -- I lead the CodeRush team at DevExpress.
像 Javascript Intellisense 这样的东西的问题在于,它确实需要具有超自然的力量才能了解一段代码的含义。就像这里,在这个函数片段中:
现在我刚刚输入了“.”。在“a”之后,我点击“tab”以自动完成。 IDE 能做什么?
在某些有限的情况下,你可以做出一些不错的猜测;例如,如果您告诉编辑器您正在使用 jQuery,那么编辑器可以做出一些假设,并且它很
清楚地认为使用 jQuery API 完成是正确的事情。然而,这永远不会比猜测好多少。即使有了那个 jQuery 示例,编辑器仍然会遇到一些难题:
在“.”之后,自动完成功能应该向我显示什么?好吧,一个超级聪明的编辑器可能愿意冒险假设“元素”是一个 DOM 节点,但它必须是超自然的才能知道 DOM 节点的种类 。
现在,人们可以做的另一件事是启用某种全面的提示系统,以便程序员可以明确地告诉编辑器什么是什么。对我来说,这会让 Javascript 失去一点灵魂,但我想有些人可能会发现它很有用。
The problem with something like Javascript Intellisense is that it really needs to have supernatural powers in order to have any clue about what a piece of code means. Like here, in this function fragment:
Now I've just typed that "." after "a", and I hit "tab" for auto-complete. What is an IDE to do?
In some limited cases, you can make some OK guesses; like, the editor can make some assumptions if you've told it you're using jQuery for example, and it sees
well it's a decent guess that completing with jQuery APIs is the right thing to do. That's never going to be much better than a guess, however. Even with that jQuery example, the editor is still going to be stuck with some hard problems:
After that ".", what should auto-complete show me? Well, a super-smarty editor might be willing to go out on a limb and assume that the "element" is a DOM node, but it'd have to be paranormal to know what kind of DOM node.
Now, another thing one could do would be to enable some sort of comprehensive hinting system, such that the programmer could explicitly tell the editor what's what. That'd take a little bit of the soul out of Javascript for me, but I guess some people might find it useful.
JS 最近才成为一种重量级的应用程序开发语言。相比之下,Java 已被富有的大公司使用了很多年,这让公司和开源项目有更长的时间来投资金钱/时间来构建工具。
构建像样的软件需要很长时间。
JS has only recently become a serious heavy-weight development language for applications. Java by contrast has been used by big rich corporations many years, giving companies and open-source projects alike much longer to invest money/time in building tools.
Building decent software takes a long time.