resharper

Resharper, “Return type can be IEnumerable…” but why? [duplicate]

早过忘川 提交于 2019-12-23 09:25:11
问题 This question already has answers here : Resharper suggests parameter can be of type 'BaseType' (2 answers) Closed 6 years ago . I have an interface like so... public interface IAccountRepository : IDisposable { IQueryable<Account> FindByUserId(int userId); //here, Resharper says "Return type can be IEnumerable<Account>" } But Resharper is suggesting me to change it to IEnumerable<Account> FindByUserId(int userId) instead. Why is that so? Wouldn't it force the entire objects to be loaded into

running xunit tests included in a .NET Standard 1.6 library

ぐ巨炮叔叔 提交于 2019-12-23 09:17:33
问题 I just created a netstandard library in Visual Studio 2017 and added references to xunit and xunit.runner.visualstudio , but the VS Test Explorer and Resharper 2017 EAP 3 are not recognizing any tests. I've seen: Unit testing a .NET Standard 1.6 library but project.json is gone and csproj is back in place. What do I have to do, to be able to run the unit tests included in a netstandard library? Library.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard1.6<

How do I setup per-assembly resharper settings

天涯浪子 提交于 2019-12-23 08:55:06
问题 I work in a codebase where for historic reasons not all projects have identical coding conventions. In fact, within a single .sln I have projects requiring different naming conventions. Is there a way to have resharper use different settings based on which project the file I'm editing lives in? 回答1: Check out the Resharper Settings Manager tool You'll need to first install the ReSharper Power Toys to use it. 回答2: Since ReSharper 6.1 you can finally have per project settings ! Basically, all

Resharper: Code snippets with tab+tab

点点圈 提交于 2019-12-23 08:30:15
问题 In VS, to use snippets (for example auto-implented property) I typed "prop", then hit TAB twice. However R# (I'm using R#6) inserts the snippet after ONE tab, causing me to always mistype something. Is there an option somewhere, where I can set it to use two tabs ? 回答1: Unfortunately there's no way that I'm aware of that would let you reassign deployment of ReSharper live templates to two tab hits instead of a single hit. However, until you've got used to the single-tab deployment, you can

What's the difference between ReSharper `MergeSequentialChecks` and `MergeSequentialChecksWhenPossible`?

梦想与她 提交于 2019-12-23 08:30:12
问题 I'm trying to figure out what's the difference between these two rules? MergeSequentialChecks MergeSequentialChecksWhenPossible The documentation doesn't say anything about the second one. https://www.jetbrains.com/help/resharper/2016.1/MergeSequentialChecks.html And it's not quire clear for me what does it mean WhenPossible ? If ReSharper suggests to apply the first rule and merge my sequential checks, then it IS possible indeed. How it could be not possible? Here is a code example to check.

ReSharper custom pattern ambiguous with multiple member definitions

蓝咒 提交于 2019-12-23 07:48:06
问题 I am attempting to transform eager class instantiation to lazy instantiation. I've followed the eager pattern throughout the codebase, but now want to change it to the lazy alternative (and remove the setter while I'm at it). ReSharper's custom pattern find/replace seems like the perfect tool for this. Happy If I have private.... by itself, the pattern searches fine. If I have public.... by itself, the pattern searches fine. Sad As soon as I try to combine the two lines, it fails with

How to switch off Resharper check for XML commets? [duplicate]

痴心易碎 提交于 2019-12-23 07:38:27
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: missing xml comment for publicly visible type or member I don't know how I did it but suddenly Resharper is underlying all public methods (blue underline) and classes saying Missing XML comment for publicly visible... followed by class or member and name. How (and where) can is disable this ? Cannot find it in Resharpers options (I have tried ReSharper -> Options -> Inspection Severity ). 回答1: ReSharper checks

Partial class doesn't match to auto-generated class part

十年热恋 提交于 2019-12-23 07:37:23
问题 I've created entity model for my DB classes, here is one of them: [EdmEntityTypeAttribute(NamespaceName="SotiModel", Name="SKUPrice")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class SKUPrice : EntityObject { ... } and created partial class for one of them public partial class SKUPrice { } The problem here is that 'partial' world is written in 'light' color and resharper suggests: 'partial class with a single part' . It seems like my 'own' part of partial class

Is there an option in ReSharper to add a blank line after a closing bracket

泪湿孤枕 提交于 2019-12-23 06:56:26
问题 I would like to add a blank line after a closing bracket inside of a method. I cannot find a setting for this. Here is some sample code. What I have: if (something != null) { something = 1; } var andThen = 2; What I want: if (something != null) { something = 1; } var andThen = 2; edit: I have version 8.1.23.546. 回答1: I just wanted to comment that this will be fixed in version 2017.3 of R# and that it is already fixed in R# 2017.3 EAP 7 which can be downloaded from here. Updated C# Formatting

Is there an option in ReSharper to add a blank line after a closing bracket

只愿长相守 提交于 2019-12-23 06:56:15
问题 I would like to add a blank line after a closing bracket inside of a method. I cannot find a setting for this. Here is some sample code. What I have: if (something != null) { something = 1; } var andThen = 2; What I want: if (something != null) { something = 1; } var andThen = 2; edit: I have version 8.1.23.546. 回答1: I just wanted to comment that this will be fixed in version 2017.3 of R# and that it is already fixed in R# 2017.3 EAP 7 which can be downloaded from here. Updated C# Formatting