TypeScript重命名变量 [英] TypeScript rename variable

查看:236
本文介绍了TypeScript重命名变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Anders Hejlsberg在channel9上显示,您可以使用Visual Studio TypeScript插件在多个文件中重命名变量. cf .:视频

Anders Hejlsberg shows on channel9 that you can rename variables across multiple files with the Visual Studio TypeScript plugin. cf.: video introduction to TypeScript by Anders Hejlsberg at 50:08.

但是,当我打开重构"菜单时,所有项目都被停用,包括重命名".我正在使用最新版本的VS2012 Professional.也许这与我系统上安装的ReSharper有关.谁能确认这是一个错误,还是重命名功能仍在开发中?

However, when I open the Refactoring menu, all items are deactivated, including Rename. I'm using the latest version of VS2012 Professional. Maybe this is related to ReSharper which is installed on my system. Can anybody could confirm this as a bug or is the Rename feature still in development?

编辑,因为我可能不会将其发布为答案:

Edit since I may not post this as an answer:

ReSharper会覆盖一些原始的Visual Studio菜单项. RESHARPER -> Options -> Keyboard & Menus -> Hide overriden Visual Studio menu items处有一个复选框.

ReSharper overrides some original Visual Studio menu items. There is a checkbox at RESHARPER -> Options -> Keyboard & Menus -> Hide overriden Visual Studio menu items.

选中此项,原始的重构"菜单会再次出现. Rename功能可以正常工作.

Check this and the original Refactoring menu shows up again. There is the Rename feature which is working just fine.

推荐答案

ReSharper(7.1.1)没有对TypeScript的内置重命名支持.如果您安装了ReSharper,则它可能会覆盖(并隐藏)Visual Studio的本机重命名-这是默认功能.

ReSharper (7.1.1) doesn't have built-in rename support for TypeScript. If you have ReSharper installed it is probably overriding (and hiding) Visual Studio's native rename -- this is the default functionality.

要显示并启用Visual Studio的重命名,您需要取消选中以下选项:

To show and enable Visual Studio's rename you need to uncheck the following option:

RESHARPER->选项->键盘和放大器;菜单->隐藏覆盖的可视 Studio菜单项

RESHARPER -> Options -> Keyboard & Menus -> Hide overriden Visual Studio menu items

(根据对这篇文章的评论,您可以投票通过以下链接将该功能添加到ReSharper: http://youtrack.jetbrains.com/issue/RSRP-330454 )

(Per the comments to this post, you can vote for this feature to be added to ReSharper at the following link: http://youtrack.jetbrains.com/issue/RSRP-330454)

这篇关于TypeScript重命名变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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