resharper

ReSharper Line Breaks and Wrapping

我只是一个虾纸丫 提交于 2019-12-04 08:13:29
问题 So, this: cmd = new OdbcCommand( string.Format( @" SELECT * FROM Bobby_Tables WHERE Name = {0}", "Little Bobby Drop Tables" ), odbcConnection ); gets formatted to: cmd = new OdbcCommand( string.Format( @" SELECT * FROM Bobby_Tables WHERE Name = {0}", "Little Bobby Drop Tables" ), odbcConnection ); I've looked at each of the options for line breaks and wrapping but I haven't been able to find the one to keep things on the same line as long as possible. I'm assuming that I missed the correct

Is it really worth purchasing R# for VS2010?

烈酒焚心 提交于 2019-12-04 08:06:54
问题 I heard that R#5.0 (still in beta) will support VS 2010. My question is VS2010 == VS2008 + ReSharper ? I know there are many improvements to VS2010, so I 'm not sure weather is it really worth purchasing the R#5.0 for VS2010? 回答1: Well, I haven't explored VS 2010 new refactoring features that much, but its my understanding that VS has some but definitely not all of resharpers features implemented (From MSDN): Navigate To You can use the Navigate To feature to search for a symbol or file in

How to convert a C# object initializer to use a constructor using Resharper structural find and replace

回眸只為那壹抹淺笑 提交于 2019-12-04 07:53:56
I want to use a Resharper structural search and replace template to automatically replace examples of this: new Fruit { Name = "Apple", IsTasty = true } With this: new Fruit("Apple", true) (Note, the required constructor already exists) I've tried various combinations like this: new $type$ { Name = $name$, IsTasty = $isTasty$ }; ...using various different Placeholder types, but R# doesn't find any of the examples in my code. Has anyone done this before? So I just did this in resharper (9.0.2 I think) Create pattern: FruityChange new $type$ { Name = $param1$, IsTasty = $param2$ } $type$ is a

C# sizeof(enum) alternative? (to workaround resharper false error)?

孤街醉人 提交于 2019-12-04 06:41:08
In C# I've got some "safe" API code related to UAC elevation. It involves getting the size of an enum (as follows) int myEnumSize = sizeof (MyEnum); The code itself is valid, compiles, works correctly etc. But Resharper falsely flags it as a an error ("Cannot use unsafe construct in safe context") within the solution. ( Starting with version 2.0 of C#, applying sizeof to built-in types no longer requires that unsafe mode be used. ) I love Resharper, and I love the solution analysis, but with this code in the solution I have a big red dot in the corner that makes me always think something is

My ReSharper Gutter Icons for Unit Tests aren't showing

泄露秘密 提交于 2019-12-04 06:09:05
I've installed ReSharper 4.1 and Gallio 3.0.5, but I don't get the gutter icons for unit tests. The tests seem to run fine in the Test Explorer, but I don't have icons next to the tests in code. What could be causing this? I previously had the MbUnit 2.4 ReSharper plugin installed, but it should be uninstalled now. I did this to get them to show up again. Maybe it was an overkill. Uninstall ReSharper Uninstall Gallio Delete %appdata%\JetBrains folder Install ReSharper Start Visual Studio Close Visual Studio Install Gallio Start Visual Studio I think the key was deleting the %appdata%\JetBrains

Create a generic type to find implementations of in a Resharper plugin

怎甘沉沦 提交于 2019-12-04 04:12:38
问题 I'm writing a plugin for resharper which I want to use to navigate from a ConcreteCommand -> ConcreteCommandHandler where those types look like this public class ConcreteCommand : ICommand public class ConcreteCommandHandler : ICommandHandler<ConcreteCommand> I've got as far as adding my navigation menu option when the cursor is on a ICommand instance/definition (currently only by checking if the name contains 'Command' and not 'CommandHandler'), and I think I have the code necessary to

An expression tree may not contain a reference to a local function

痴心易碎 提交于 2019-12-04 03:51:13
Error: An expression tree may not contain a reference to a local function public void Initialize() { CloudStorageProperties ImageFileProperties(string fileName) => _cloudStorage.GetBlob(CloudStorageType.Image, fileName).FileProperties; Config = new MapperConfiguration(x => { x.CreateMap<Category, CategoryViewModel>() .ForMember(vm => vm.ImagePath, m => m.MapFrom(src => ImageFileProperties(src.ImageFile.Name).Uri.AbsoluteUri)); }); } I can replace the local function with an anonymous function and it works but re sharper says that I should convert it to a local function. Why is this not allowed?

Adding Resharper code annotation to own code in a non-invasive manner

白昼怎懂夜的黑 提交于 2019-12-04 03:16:05
I want to flag one of my methods with the StringFormatMethod attribute so Resharper syntax highlights it. I was able to do this by referencing the JerBrains.Annotations assembly and adding the attribute. However I find this to be a very invasive way to do this. Not everybody here uses JetBrains and it will require committing the .dll to subversion, adding the dependency and littering the code with something that is specific to a particular IDE, which I hate. I read about the "external annotations" feature, but I wasn't able to do it. I'm not sure if I did it wrong or if it's simply not

How to prevent auto-closing of curly braces in ReSharper?

≡放荡痞女 提交于 2019-12-04 02:44:54
问题 A simple question. I'm trying out ReSharper and it closes my curly braces for me as soon as I open them. I really dislike this "feature" and I've had about three long looks through the settings window and I can't seem to figure out how to disable it! Am I missing an obvious check-box somewhere? Edit: The unchecking of "Auto close parenthesis after completion" does not do the trick! I want to be able to type the following without } appearing for me: if(true){ This doesn't seem like anything to

Convert to Method Group Resharper

左心房为你撑大大i 提交于 2019-12-04 02:44:41
问题 I have written a method below like this: internal static IList<EmpowerTaxView> GetEmpowerTaxViewsByLongAgencyAndAgencyTaxTypes( IList<EmpowerCompanyTaxData> validEmpowerCompanyTaxDatas, IList<EmpowerTaxView> empowerTaxViews) { IList<EmpowerTaxView> result = new List<EmpowerTaxView>(); foreach (EmpowerCompanyTaxData empowerCompanyTaxData in validEmpowerCompanyTaxDatas) { IList<EmpowerTaxView> validEmpowerTaxViews = GetEmpowerTaxViewsByLongAgencyAndTaxType( empowerCompanyTaxData,