Eclipse> WST> JSDT Javascript重构在一半时间内重命名变量 [英] Eclipse>WST>JSDT Javascript Refactoring Renaming variables working half of the time

查看:146
本文介绍了Eclipse> WST> JSDT Javascript重构在一半时间内重命名变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse (我目前正在运行3.8.0 @ Linux(Mint 14(Ubuntu(Debian))),使用 Refactor 是一个似乎随机可用的选项。对于一些代码,它在那里,对于其他代码,它不是。

In Eclipse (I am running 3.8.0 @ Linux (Mint 14 (Ubuntu (Debian))) at the moment), renaming variables using Refactor is an option that seems randomly available. For some code it's there, and for other code it's not.

我试图看到一个模式为什么一些 var 声明是重命名的,而其他人不是,但我还没有找到。

I tried to see a pattern why some var declarations are up for renaming and others are not, but I haven't found it yet.

为什么refactor->重命名不适用于某些代码?如何使这项工作?

Why does refactor->rename not work for some code? How can I make this work?

您可以通过突出显示的参考资料了解Eclipse非常了解应该重构的内容,,所以我不明白问题是什么。

You can see by the highlighted references that Eclipse is very aware of what should be refactored, so I don't understand what the problem is.

没问题:

No problem:

问题:

推荐答案

您可以随时使用 Ctrl + 2 + R (出现一个小的下拉菜单后按R)重构变量... [有机会]。

You can always use Ctrl + 2 + R (Press R after appearing a small dropdown) to refactor the variable... [ Got it by chance ].

更新

在Eclipse上工作Neon ...不能说其他旧版本。因为它是我正在撰写答案时最新的稳定版本。

working on Eclipse Neon... can't say about other older version. because it is the latest stable version at the time I am writing the answer.

更新3-May-2017

一个缺点是它会替换文件中该变量的所有出现。
需要特别小心。

one drawback is that it replaces all occurrences of that variable in the file. special care is required.

这篇关于Eclipse> WST> JSDT Javascript重构在一半时间内重命名变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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