resharper

Disable just the switch snippet in resharper 8 (c#)

血红的双手。 提交于 2019-12-06 05:02:32
问题 I find that the default VS 2013 switch snippet works a lot better than the one from resharper. any way to just disabe that? 回答1: I see a couple of ways to get this: With ReSharper IntelliSense Uncheck 'switch' here: ReSharper | Templates Explorer | Live Templates | C#; Type 'switch' in code editor; Hit 'Esc' to hide IntelliSense popup; Hit 'Tab' to insert VS "switch" code snippet. With VS IntelliSense Uncheck 'switch' here: ReSharper | Templates Explorer | Live Templates | C# Select 'Visual

Resharper thinks that typecast is redundant, but without typecast the code does not work

此生再无相见时 提交于 2019-12-06 04:43:05
Iterating JsonData through foreach fetches IDictionary enumerator instead of IList one. foreach (var jsonEntry in jsonData) This causes my code to throw an error. InvalidOperationException: Instance of JsonData is not a dictionary LitJson.JsonData.EnsureDictionary () LitJson.JsonData.System.Collections.Specialized.IOrderedDictionary.GetEnumerator () LitJson.JsonData.System.Collections.IDictionary.GetEnumerator () Casting the object to IList causes Resharper to issue a warning "Type cast is redundant." foreach (var jsonEntry in jsonData as IList) Why does Resharper think the cast is redundant ?

Only keep used types and remove unused types

跟風遠走 提交于 2019-12-06 03:48:31
Is there any way to remove unused types/code from a project. lets say I'm using NAudio (source code) in my console application and I'm only using the WaveIn class from it. Is there any way for me to remove unused classes from the code and only keep the WaveIn class and the classes WaveIn depends upon? Something down the line of tree shaking Ndepend was the answer from t in Types let depth0 = t.DepthOfIsUsedBy("NAudioTrim.Program") where depth0 >= 0 orderby depth0 select new { t, depth0 } where NAudioTrim.Program contains the entry point of my application and contains the used types. Once you

Stack trace for Jasmine test with the Resharper 7 test runner

左心房为你撑大大i 提交于 2019-12-06 03:19:56
How do you get the Resharper 7 test runner to show the stacktrace for Jasmine tests. My setup is Resharper 7 (build in Jasmine) testrunner and PhantomJs. When executing any failing test the error message always ends with: Exception doesn't have a stacktrace In the 1.6 "Lavender" version of Phantom has added the feature to print the stacktrace when an error occurs. To replicate this just create a mytest.js file and add the following code to it: describe("A suite", function() { it("contains spec with an expectation", function() { expect(true).toBe(false); }); }); Sorry, I don't use Resharper,

How do I specify that a Func object doesn't return null with JetBrains annotations?

自古美人都是妖i 提交于 2019-12-06 02:38:11
I have a bit of code: public void Foo([NotNull] Func<string> bar) { //whatever } My problem is, the [NotNull] annotation is specifying that bar itself is not null. I'm looking instead for an annotation that says that the thing RETURNED BY BAR is not null. I expected that this was possible but it doesn't seem to be. They support ItemNotNull for IEnumerables so I don't see why we can't have ReturnsNotNull for Func objects. Am I just missing something obvious here? Surely something this basic is supported. 来源: https://stackoverflow.com/questions/35091582/how-do-i-specify-that-a-func-object-doesnt

My ReSharper Gutter Icons for Unit Tests aren't showing

♀尐吖头ヾ 提交于 2019-12-06 01:51:20
问题 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. 回答1: 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

Is it possible to get Visual Studio or Resharper to highlight enum's with a different color?

非 Y 不嫁゛ 提交于 2019-12-06 01:48:18
问题 I think code would be more readable if it highlighted enums properties with a different color to class properties. 回答1: For VS2010 / VS2013 / VS2015 / VS2017 / VS2019: Tools->Options->Environment->Fonts and Colors: Show Settings For Text Editor Display Items: User Types (Enums) Change Item Foreground 回答2: You have to enable "Color identifiers" in ReSharper -> Options -> Code Inspection -> Settings . Then you can define the forground/background colors for Enum identifiers in Tools -> Options -

VS 2010: Can’t insert mvvm-light snippet using shortcut - incompatibility with resharper 5?

試著忘記壹切 提交于 2019-12-05 21:29:55
i recently installed some snippets that come with the mvvm-light framework i am using. And sure enought i checked via Tools > Code Snippet Manager and they are installed under "My Code Snippets". If i do insert Snipper (right click in code window) or CTRL K + CTRL X then i can search within all available snippets.... But i do believe its possible to just type the shortcut key (in this case it is mvvmlocatorproperty) and pressing tab inserts the snippet BUT when i type the shortcut key it is not recognizing anything... What am i doing wrong?? This is not an incompatibility with resharper 5? -

How can I find all usages of a namespace and its members?

天大地大妈咪最大 提交于 2019-12-05 20:44:45
问题 I am trying to search a large solution for any usages of a given namespace or its members, say, System.IO . Resharper's Find Usages allows me to find references to System.IO , but only when used explicitly. If a file declares using System.IO; then uses any of the namespace's members without the full name, only the using reference is found. I need to find any usage of any member of the namespace in each file as well. Can this be accomplished in Visual Studio, Resharper, or any other plugin do

How to navigate to feature file from resharper test session window in Visual Studio 2012?

回眸只為那壹抹淺笑 提交于 2019-12-05 20:37:42
For acceptance testing I use TeckTalk SpecFlow in Visual Studio 2012. When I run all specflow scenarios, resharper unit test session windows is opened I can see all test results. Like on screen shot below. The question is, when I see failed test (scenario) in some feature file, how can I navigate directly to this feature file from resharper session window to edit it??? It seems to work perfectly well if run via the new VS2012 Test explorer, which on my machine worked automatically from "Run SpecFlow Scenarios" on the project menu. I can only assume Resharper is getting in the way on your