DevExpress 在 Javascript 重构方面取得了多大进展?

发布于 2024-08-24 12:16:48 字数 551 浏览 5 评论 0原文

一年多前,我记得看到一位 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

他夏了夏天 2024-08-31 12:16:48

CodeRush 支持 52 种 JavaScript 重构:

  • 添加块定界符
  • 添加参数
  • 分解参数
  • 分解参数 条件
  • 条件
  • 组合条件(嵌套)
  • 组合条件(并行)
  • 压缩赋值
  • 压缩为三元表达式
  • 连接字符串
  • 条件为条件
  • 创建多变量声明
  • 创建重载
  • 创建 Setter 方法
  • 创建 With 语句
  • 展开赋值
  • 展开三元表达式
  • 提取方法 展
  • 平条件
  • For 到 ForEach
  • ForEach 到 For
  • 初始化 有条件
  • 内联 最近赋值
  • 内联结果内
  • 联临时 内
  • 联 With 语句
  • 引入本地
  • 引入本地(替换全部)
  • 引入结果变量
  • 排列参数
  • 行- up 参数
  • 将声明移至引用附近
  • 将初始化移至声明
  • 提升至参数
  • 删除块定界符
  • 删除参数 删除
  • 冗余条件
  • 重命名 本地
  • 重新排序参数
  • 用查询替换 Temp
  • 用本地
  • 反向条件
  • 替换简化表达式
  • 拆分条件
  • 拆分条件(和重复的 else 块)
  • 从声明拆分初始化
  • 分割多变量声明
  • 分割字符串
  • 分割临时变量
  • 分割With语句
  • 扩大范围
  • 扩大范围(提升到字段)

以及八个先消费声明和快速修复功能:

  • 添加合同
  • 添加Else语句
  • 声明字段
  • 声明本地
  • 镜像代码
  • 反向For循环
  • 旋转90度
  • 拼写检查器

此外,我们正在努力改进对 10.2 版本的重构支持。我们最近还改进了快速导航,使导航到 JavaScript 函数就像在 C# 或 VB 中导航一样简单。这项改进将在 10.2 中发布,但现在 CodeRush 客户可以在日常构建中使用。

全面披露——我领导 DevExpress 的 CodeRush 团队。

CodeRush supports fifty-two JavaScript refactorings:

  • Add Block Delimiters
  • Add Parameter
  • Break Apart Arguments
  • Break Apart Parameters
  • Case to Conditional
  • Combine Conditionals (nested)
  • Combine Conditionals (parallel)
  • Compress Assignment
  • Compress to Ternary Expression
  • Concatenate Strings
  • Conditional to Case
  • Create Multi-variable Declaration
  • Create Overload
  • Create Setter Method
  • Create With Statement
  • Expand Assignment
  • Expand Ternary Expression
  • Extract Method
  • Flatten Conditional
  • For to ForEach
  • ForEach to For
  • Initialize Conditionally
  • Inline Recent Assignment
  • Inline Result
  • Inline Temp
  • Inline With Statement
  • Introduce Local
  • Introduce Local (replace all)
  • Introduce Result Variable
  • Line-up Arguments
  • Line-up Parameters
  • Move Declaration Near Reference
  • Move Initialization to Declaration
  • Promote to Parameter
  • Remove Block Delimiters
  • Remove Parameter
  • Remove Redundant Conditional
  • Rename Local
  • Reorder Parameters
  • Replace Temp with Query
  • Replace with Local
  • Reverse Conditional
  • Simplify Expression
  • Split Conditional
  • Split Conditional (and duplicate else block)
  • Split Initialization from Declaration
  • Split Multi-variable Declaration
  • Split String
  • Split Temporary Variable
  • Split With Statement
  • Widen Scope
  • Widen Scope (promote to field)

And eight consume-first declaration and quick fix features:

  • Add Contract
  • Add Else Statement
  • Declare Field
  • Declare Local
  • Mirror Code
  • Reverse For Loop
  • Rotate 90 Degrees
  • Spell Checker

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.

木落 2024-08-31 12:16:48

像 Javascript Intellisense 这样的东西的问题在于,它确实需要具有超自然的力量才能了解一段代码的含义。就像这里,在这个函数片段中:

return function(a) {
  var x = a.

现在我刚刚输入了“.”。在“a”之后,我点击“tab”以自动完成。 IDE 能做什么?

在某些有限的情况下,你可以做出一些不错的猜测;例如,如果您告诉编辑器您正在使用 jQuery,那么编辑器可以做出一些假设,并且它很

$('something').

清楚地认为使用 jQuery API 完成是正确的事情。然而,这永远不会比猜测好多少。即使有了那个 jQuery 示例,编辑器仍然会遇到一些难题:

$('something').each(function(_, element) {
  if (element.

在“.”之后,自动完成功能应该向我显示什么?好吧,一个超级聪明的编辑器可能愿意冒险假设“元素”是一个 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:

return function(a) {
  var x = a.

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

$('something').

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:

$('something').each(function(_, element) {
  if (element.

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.

噩梦成真你也成魔 2024-08-31 12:16:48

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文