admin管理员组文章数量:1024625
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.
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.
Why does refactor->rename not work for some code? How can I make this work?
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:
Problem:
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.
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.
Why does refactor->rename not work for some code? How can I make this work?
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:
Problem:
Share Improve this question edited Jun 22, 2013 at 20:43 Redsandro asked Jun 20, 2013 at 11:37 RedsandroRedsandro 11.4k15 gold badges80 silver badges111 bronze badges3 Answers
Reset to default 3You can always use Ctrl + 2 + R
(Press R after appearing a small dropdown) to refactor the variable... [ Got it by chance ].
Update
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.
Update 3-May-2017
one drawback is that it replaces all occurrences of that variable in the file. special care is required.
I noticed that renaming is not available, when the project is not a JS project or if I open it with the non-default JS editor. (Spket JS Editor in my case.)
So try this:
- Make sure in your .project file jsNature is set.
E.g. (In my case I have JS code inside a Java project):
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
- Right click file -> Open with -> JavaScript Editor
Works for my using Eclipse Kepler.
I can rename the local variable under Aptana Studio 3.0 (Eclipse based) with the JSDT "JavaScript Editor" and in the screenshot shown JS function: https://i.sstatic/qnkJj.jpg
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.
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.
Why does refactor->rename not work for some code? How can I make this work?
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:
Problem:
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.
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.
Why does refactor->rename not work for some code? How can I make this work?
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:
Problem:
Share Improve this question edited Jun 22, 2013 at 20:43 Redsandro asked Jun 20, 2013 at 11:37 RedsandroRedsandro 11.4k15 gold badges80 silver badges111 bronze badges3 Answers
Reset to default 3You can always use Ctrl + 2 + R
(Press R after appearing a small dropdown) to refactor the variable... [ Got it by chance ].
Update
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.
Update 3-May-2017
one drawback is that it replaces all occurrences of that variable in the file. special care is required.
I noticed that renaming is not available, when the project is not a JS project or if I open it with the non-default JS editor. (Spket JS Editor in my case.)
So try this:
- Make sure in your .project file jsNature is set.
E.g. (In my case I have JS code inside a Java project):
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
- Right click file -> Open with -> JavaScript Editor
Works for my using Eclipse Kepler.
I can rename the local variable under Aptana Studio 3.0 (Eclipse based) with the JSDT "JavaScript Editor" and in the screenshot shown JS function: https://i.sstatic/qnkJj.jpg
本文标签: EclipsegtWSTgtJSDT Javascript Refactoring Renaming variables working half of the timeStack Overflow
版权声明:本文标题:Eclipse>WST>JSDT Javascript Refactoring Renaming variables working half of the time - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745611699a2159038.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论