resharper

Visual Studio dump all properties of class into editor

倖福魔咒の 提交于 2019-12-03 17:50:11
问题 Ok, here is one for the people that have lots of handy little add ins for visual studio, or can help with a keypress sequence. Let's say I have a Person class: class Person { string Name { get; set; } int Age { get; set; } } And I'm busy coding away happily. I often get the situation where I need to assign values to all the properties of that class, or assign all the values of the properties to something else. public override void CopyTo(Person myPerson) { myPerson.Name = "XXX"; myPerson.Age

Resharper reformatting Linq statement to put into and select on same line

天涯浪子 提交于 2019-12-03 15:49:46
When I type in a Linq query style statement like var stuff = from x in things group x by x.Something into g select g; Resharper is reformatting it to var stuff = from x in things group x by x.Something into g select g; And then complains about it because it breaks the StyleCop rule SA1103. Is this a bug in Resharper or is there some combination of settings that I need to change to keep it from doing this reformatting? Edit JetBrains has confirmed that this is a bug and it is fixed in version 8.0. Looking at the options for ReSharper, there is a single option under Code Editing -> C# ->

Brace highlighting in Visual Studio for Javascript?

你说的曾经没有我的故事 提交于 2019-12-03 14:53:16
问题 Is there a way to get Visual Studio 2008 to do matching brace highlighting for Javascript? If there is no way to do it in Studio, can it be done using ReSharper? Thanks!! 回答1: Note that Visual Studio will still find a matching brace in JavaScript via Ctrl + ]. 回答2: Here is an extension for VS2010 that will do just what you desire. And it's free! http://visualstudiogallery.msdn.microsoft.com/872d27ee-38c7-4a97-98dc-0d8a431cc2ed 回答3: You could give Visual Assist X a go: http://www.wholetomato

ReSharper gives an “@” prefix to a variable name in a lambda expression

回眸只為那壹抹淺笑 提交于 2019-12-03 14:35:47
问题 When using ReSharper it automatically adds an @ , why? public static string RemoveDiacritics(this string input) { if (string.IsNullOrEmpty(input)) return input; var normalizedString = input.Normalize(NormalizationForm.FormD); var stringBuilder = new StringBuilder(); foreach (var value in normalizedString.Select(value => new {value, unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(value)}) .Where(@t => @t.unicodeCategory != UnicodeCategory.NonSpacingMark) .Select(@t => @t.value))

Let Resharper force this keyword on fields

若如初见. 提交于 2019-12-03 14:25:49
问题 Does anyone know if it is possible to have resharper force the use of the this keyword when it can be used? For fields and such... Resharper is capable of showing where it can be removed, but our coding standard tells us to use the this keyword. 回答1: In ReSharper Options, under Code Editing -> C# -> Code Style there is an option for Use "this." qualifier for that you can set for fields, properties, events, and methods. 回答2: Checkout the StyleCop for Resharper plugin (part of the StyleCop

Referring to a generic type of a generic type in C# XML documentation?

吃可爱长大的小学妹 提交于 2019-12-03 14:23:15
问题 Writing some XML documentation for a predicate helper class. But I can't figure out I can refer to an Expression<Func<T, bool>> without getting a syntax error. Is it even possible? I have tried this: <see cref="Expression{Func{T, bool}}"/> But I get a red squiggly line under {T, bool}} . This works though: <see cref="Expression{TDelegate}"/> Anyone have a clue? Update: The answer that was given (and I accepted) seemingly did work. But now I have started to get a lot of warnings about stuff

How to see .net library source code with ReSharper 5 and visual studio 2010?

淺唱寂寞╮ 提交于 2019-12-03 12:31:35
I used to see any .net source code (like System.String) with ReSharper and Visual Studio 2008. since I migrated to Visual studio 2010, this option doesn't give the full source code but just the definitions of the class. How can I fix this, to use the microsoft's symbols server again? Edit : Maybe the problem is only with .net-4.0 assemblies. is microsoft released symbols to to .net-4.0 assemblies also? Microsoft released sources for .NET 4 release, so R# have to work just fine. Some debugging information may be found in View -> Output -> ReSharper after unsuccessful navigation. Sometimes R#

Why does resharper suggest const, static operations?

女生的网名这么多〃 提交于 2019-12-03 12:21:19
I was wondering why resharper suggests a method to be static in non static class? Is it for saving the creation of the instance? Is it a matter of performance? also, why does it suggest to 'const' some params? Is it a matter of performance ? I would love to get some explanation When compiler encounters a static method it emits call instructions but when it encounters an instance method it emits callvirt instruction. Now the callvirt instruction checks the object whether it is null before making the call. so there is a performance penalty attached to it .But it helps in making the method call

Is there any way to turn off Resharper 7 auto formatting?

你离开我真会死。 提交于 2019-12-03 12:11:06
This has been driving me crazy, I've tried Resharper support with no solution, but wondered if anyone out there has experienced this. When I update an existing method and hitting the curly brace or semi-colon, I am getting a double indent: public void abc(int a, int b) { var c; // <- after hitting return after the curly brace var d; var e; } Is there any way to completely turn off Resharper formatting? Or at least fix this problem? I've looked in the Resharper->Code Editing->C# but didn't find anything that worked. PS - This is on VS 2010 Both ReSharper and Visual Studio have auto-formatting.

Shortcut to Navigate back in visual studio 2010 and resharper

两盒软妹~` 提交于 2019-12-03 11:40:20
I'm just getting back to visual studio 2010 after using phpStorm (jetBrain's product) and I'm missing all the nice shortcut keys. I've installed visual studio 2010 with resharper but am still missing some of the nice features. I can't figure out how to "navigate back" in my code. For example if I'm navigating to various method definitions and then I want to navigate back to where I just was how do I do this? I believe that in phpstorm I would press Ctrl + Alt + Left to go navigate back and Ctrl + Alt + Right if I wanted to go forward. It would keep a history so I could just keep going back as