resharper

Break lines and wrapping in auto formatting of Visual Studio with ReSharper

老子叫甜甜 提交于 2019-12-04 14:57:41
问题 I'm working in a C# project and using Visual Studio 2012. When Visual Studio tries to format my code, it breaks lines and make my code look difficult to read. The original code (what looks pretty nice to read for me and my team): if (list.Any(x => x.Type == (int) EnumType.Customer)) { } And when Visual Studio tries to format: if ( list.Any( x => x.Type == (int) EnumType.Customer)) { // Other break codes } There are a lot of other parts where it is breaking my code. I like auto formatting for

How to debug in Visual Studio with NSpec

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:55:53
how do I debug in visual studio with NSpec? I've resharper installed I need to step into my test code. At least in Visual Studio 2013, the NSpec Test Adapter (by {o} Software) seems to do the trick. Find it in the Extensions gallery. Then just right-click on the test in the Test Explorer and hit Debug. Another good option is to just type System.Diagnostics.Debugger.Launch() in the test you want to debug. You'll get a Visual Studio prompt to debug the test. I would also recommend taking a look at specwatchr . I use a simple trick that let's me debug NSpec with resharper out of the box. The idea

Is there a way to emulate ReSharper's “extend selection” feature in Vim?

霸气de小男生 提交于 2019-12-04 11:42:50
问题 ReSharper has a nice feature called "extend selection": by pressing CTRL+W (I think this is the default) repeatedly, you select more and more from your current caret location. First it's a word, then more and more words, a line, inner then outer block of lines (for example an if-block), then a function, etc... Basically, by pressing the key combination repeatedly, you can end up selecting the entire file. I'm sure at least some of you will be familiar with it. I have just started learning all

How to make Resharper format line-wrapped ternary operators in the following way

99封情书 提交于 2019-12-04 10:40:48
问题 I really want Resharper to format my line-wrapped ternaries in this way return navigator.IsTerminating ? navigator.Context : navigator.Context.GetSimulatableRelative(new Navigator(navigator)); Can anyone help with this? 回答1: I don't think there is an out of the box way of doing this. The only way i know to influence how R# formats code is through these settings: Resharper --> Options... --> Langauges --> C# --> Formatting Style This doesn't allow you to write your own custom formatting rules

Rearrange Code shortcut in Resharper doesn't work in VS2015

眉间皱痕 提交于 2019-12-04 10:23:50
When I try to use the shortcut for moving lines up/down ( Ctrl + Alt + Shift + ↑ / ↓ ), it highlights the code and shows the tooltip message "Use Up/Down to move text line" but nothing happens. If however I try the same command via the menu bar (Resharper > Edit > Rearrange Code > Move Up) it moves the selected lines as expected. I used to use this feature all the time so I find this bug very annoying. Apparantly, others also experience this (see comments for Resharper move line up down not working ) but I haven't been able to find a solution for it. Resetting keyboard layouts and reapplying

How best to deal with gigantic source code files in Visual Studio

╄→гoц情女王★ 提交于 2019-12-04 09:59:56
I'm working on a project which makes substantial use of code generation. Some of the files it generates contain >0.25 million lines of code. VS (2K5) doesn't cope too badly, but R# (4.01) throws an out of memory exception every two minutes or so. Splitting them out into partial classes/separate files isn't an option in the immediate term, though it may be later. Are there any clever IDE tricks to dealing with this? EDIT: so people are immediately saying (very sensibly) 'don't have a file that big' and suggesting ways to break it out into smaller files. That's fine, but I'm on a time-boxed task

ReSharper sluggishness

纵饮孤独 提交于 2019-12-04 09:52:23
问题 I like ReSharper, but it is a total memory hog. It can quickly swell up and consume a half-gig of RAM without too much effort and bog down the IDE. Does anybody know of any way to configure it to be not as slow? 回答1: Turn off the on-the-fly compilation (which, unfortunately, is one of its best features) 回答2: The next release 4.5 is going to based around performance and memory footprint. see Ilya Ryzhenkov's blog Resharper 4.5 has been released From my experience it is less of a memory hog,

ReSharper API… Uh… where is it?

一世执手 提交于 2019-12-04 09:47:42
Ok I must be having a blonde moment, but for the life of me I can't find where to download the ReSharper API, to use with the project I got from here . Any help or links would be greatly appreciated. Api information: http://www.jetbrains.com/resharper/features/open_api.html You mostly need to reference various DLLs in the bin directory of the Resharper folder, then you can get started playing around. If you don't have a license to the product, that would be an obvious prerequisite. Edited to add: Here's some ancient documentation, which may get you somewhere: http://www.jetbrains.com/resharper

Resharper: Possible Multiple Enumeration of IEnumerable

混江龙づ霸主 提交于 2019-12-04 08:49:42
问题 I'm using the new Resharper version 6. In several places in my code it has underlined some text and warned me that there may be a Possible multiple enumeration of IEnumerable . I understand what this means, and have taken the advice where appropriate, but in some cases I'm not sure it's actually a big deal. Like in the following code: var properties = Context.ObjectStateManager.GetObjectStateEntry(this).GetModifiedProperties(); if (properties.Contains("Property1") || properties.Contains(

Is there a way to auto-generate GetHashCode and Equals with ReSharper?

我与影子孤独终老i 提交于 2019-12-04 08:48:54
问题 In eclipse, when I code in Java, there is a feature to auto-generate a basic, efficient, and bug free implementation of hashCode() and equals() without consuming brain power. Is there a similar feature either built-in in Visual Studio or in ReSharper ? 回答1: Yes, Resharper can do that. With cursor inside your type, open the “Generate code” menu ( Alt + Ins depending on settings or Resharper -> Edit -> Generate Code ), and select “Equality members”: This opens a window where you can select