问题标签 [resharper-8.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
194 浏览

resharper - 如何在 ReSharper 插件中创建自定义扩展点

我们正在为 ReSharper 开发插件,我们希望使我们的插件可扩展。看来,我们应该使用 ShellComponent 属性来做到这一点,但我们找不到任何例子。任何人都可以考虑如何定义自定义扩展点以及如何管理扩展。扩展点和扩展实现的代码示例将非常有帮助。

谢谢。

0 投票
1 回答
88 浏览

visual-studio-2010 - JetBrain Resharper - 将类型移动到另一个文件下拉菜单未显示

我正在遵循此位置给出的指南,此链接提到将显示“移动到另一个文件”选项,但我没有看到它。我正在使用最新版本 -

JetBrains ReSharper 8.2.2 完整版 Build 8.2.2000.5102

使用 Visual Studio - Visual Studio 10.0.40219.1。

这个功能有问题吗?

0 投票
3 回答
1188 浏览

c# - Can Resharper Intellisense be configured to sort alphabetically?

I've recently updated to using VS2013 and Resharper 8.2, (from VS2010 and Resharper 6) and have found a very annoying "feature" in that Resharper's intellisense does not sort a class's members alphabetically.

By way of example, I have an object called "client" which has a property called EthnicityRequired, and another property called Ethnicities.

Using only native VS2013 intellisense, this is what I get I type client.eth enter image description here

This is what I expect; both properties are listed together.

But, Resharper's Intellisense(less) gives me this

enter image description here

While the visible members are sorted alphabetically, the missing Ethnicities property is way down the bottom of the list and will only be matched if I type "ethnicti" so that the text no longer matches with EthnicityRequired.

From closer inspection of the list, it appears that Resharper is applying some sort of grouping and then sorting alphabetically within each group.

Does anyone know how to get rid of this rather useless behaviour, and revert to a straight alpha sort like Resharper 6.0 and earlier versions?

Bonus points if you can provide a defence of JetBrains' rationale.

0 投票
1 回答
283 浏览

c# - Resharper 可以将任何代码块移动到另一个#region 吗?

我使用了CodeRush @DevExpress。它有成员图标,您可以轻松地将代码块移动到任何#region. 但我没有在ReSharper中这样做。我希望找到解决办法。

Coderush 这样做:

0 投票
1 回答
176 浏览

visual-studio - Resharper 重构创建静态方法

当您使用 Resharper 8 重构方法并且方法参数不依赖于类的实例变量时,将构造一个静态方法。但是,也可以创建实例方法。

是否出于性能原因创建了静态方法?

TIA。

0 投票
0 回答
125 浏览

resharper - 根据变量的数据类型创建更清晰的命名约定

我正在尝试根据变量的数据类型在 resharper 中创建自定义命名约定规则。我想创建一个规则来检查变量的数据类型并推荐匹配的前缀。这甚至可能吗。

例如对于这些局部变量:

在这种情况下,resharper 规则应该在 strGender 下划线,因为 type 是 Boolean,prefix 是 str 而不是 bln。如果它建议 blnGender 为新变量名称类似地为具有 int 前缀的变量提供 Integer 类型,str 为字符串,obj 为对象,那将是很好的。

我不担心编译时的未知类型。我正在使用 ReSharper8

0 投票
0 回答
446 浏览

stylecop - ReSharper 不会抑制警告

我正在使用 ReSharper 和 StyleCop 来强加一些命名约定。我有一个类名以大写开头的规则。但是,在某些类中,我需要违反规则(当命名直接从我的数据库映射的类时,我希望它们具有表、视图等的名称,我们的约定是以小写开头的t_名称表,v_供查看)。

我正在使用该[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter"]属性抑制警告。它在一堂课上效果很好。它没有在另一个。这两个类都是部分类。在这两种情况下,我都使用相同的属性和相同的消息。但在一种情况下,我仍然可以看到 ReSharper 抱怨。

这种抑制有效:

这不会:

我尝试再次删除和添加抑制,但行为没有改变。显然,我错过了一些东西,但我看不到什么。任何帮助高度赞赏。

解决了:

在第二种情况下,有一个拼写错误:它说CShrp而不是CSharp.

0 投票
0 回答
798 浏览

c# - 使用 Resharper 从 .NET Framework 类中提取接口

最近,为了更好的单元测试覆盖率,我不得不封装很多点网框架类。我想知道是否有一种方法可以使用 Reshaper(或类似工具)之类的工具从 dot net 框架中的现有系统类中提取接口,而不是手动执行此操作。

一旦我有了接口,我就不介意自己实现具体的类。但是如果我能自动生成界面就好了。

0 投票
1 回答
1671 浏览

c# - MSTest 运行忽略的测试 (VS2013)

我最近开始使用 VS2013(之前使用的是 2010)。

我似乎不再能够通过使用 Resharper 或 Visual Studio 测试运行程序来运行被忽略的测试。这就是我声明测试方法的方式:

我以前可以手动运行这样的测试吗?此功能是否已删除?

NUnit 的 Explicit 属性仍然可以正常工作。

谢谢

0 投票
1 回答
778 浏览

c# - 有没有办法让 Resharper 忽略未使用的引用?

使用 Resharper,我们可以右键单击项目的引用并选择优化引用。这向我们展示了编译器未使用或不需要的类库。

我有一个仅用作参考的类库(永远不需要实际使用代码)。只要它是引用的一部分,dll 就被设置为在启动时注入自身。如果您很好奇为什么会这样做,它会处理 ASP.NET MVC 项目(Nuget 包页面)的未找到和错误。

有什么可能的方法可以告诉 Resharper,这个引用要么是编译器所需的一部分,要么是使用的引用的一部分?我只是想尝试防止开发人员意外删除我的 dll。