提取界面新文件设置 [英] Extract interface new file setting

查看:75
本文介绍了提取界面新文件设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我选择从快速重构菜单中提取界面时,我的设置默认为创建新文件。那个环境在哪里?也许它是一个Resharper菜单,有一个复选框,允许我选择创建一个新文件。我不再是
有resharper而且这种行为不是我想要的。

解决方案

嗨Tyboriel,


欢迎来到MSDN论坛。


请看看这个文档:

提取界面重构
它将创建一个具有指定名称的新文件,似乎没有这样的选项来设置不创建新文件,我也在我的VS 2017中测试它,它创建了一个新的接口文件。


**界面是在指定名称的文件中创建的。  ;


>>也许是一个Resharper菜单,其中有一个复选框,允许我选择是否创建新文件。


我想你是对的,请检查一下:
提取界面


**要提取新界面,请选择  提取界面 选项并指定新界面的名称。 

To重命名原始类并使其成为新创建的界面的实现,选择  重命名原始类并尽可能使用界面 选项并指定原始类的新名称.IntelliJ IDEA将
将所有原始类用法改为仅在仍然需要的情况下实现的用法。


有关VS的建议,请转到帮助 - 发送反馈 - 提供建议...并与VS产品团队分享您的用户声音,谢谢
您的反馈和建议。




最好的问候,


萨拉


When I select to extract an interface from the quick refactoring menu, my setup defaults to creating a new file. Where is that setting? Maybe it was a Resharper menu that had a checkbox that allowed me to select to create a new file or not. I no longer have resharper and this behavior is no what i want.

解决方案

Hi Tyboriel,

Welcome to the MSDN forum.

Please have a look at this doc: Extract an interface refactoring and it will create a new file with the specified name, it seems there is no such option to set not create a new file and I also tested it in my VS 2017, it creates a new interface file.

**The interface is created in the file of the name specified. 

>>Maybe it was a Resharper menu that had a checkbox that allowed me to select to create a new file or not.

I suppose you are right, please check this: Extract interface

**To extract a new interface, select the Extract Interface option and specify the name for the new interface. 
To rename the original class and make it an implementation of the newly created interface, select the Rename original class and use interface where possible option and specify the new name for the original class. IntelliJ IDEA will alter all original class usages to the usages of the implementing only where it is still necessary.

For the suggestions for VS, please go to Help-Send Feedback-Provider a suggestion… and share your user voices with the VS Product Team, thank you for your feedback and suggestions.

Best regards,

Sara


这篇关于提取界面新文件设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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