resharper

Shortcut for extract local variable in Visual Studio or ReSharper (for C#)

南笙酒味 提交于 2019-12-02 00:07:16
问题 Is there a shortcut for extracting local variable in VS or ReSharper? I know that there are shortcut for extracting field variable but I cannot find for extracting local variable. Thanks in advance. 回答1: Right-clicking a local variable, I get this context menu: Assuming you want shortcuts for the highlighted commands, you can define your own shortcuts through the Visual Studio keyboard mapper. (Tools -> Options -> Environment -> Keyboard) Introduce Variable... = "ReSharper.ReSharper

Shortcut for extract local variable in Visual Studio or ReSharper (for C#)

点点圈 提交于 2019-12-01 22:10:28
Is there a shortcut for extracting local variable in VS or ReSharper? I know that there are shortcut for extracting field variable but I cannot find for extracting local variable. Thanks in advance. Right-clicking a local variable, I get this context menu: Assuming you want shortcuts for the highlighted commands, you can define your own shortcuts through the Visual Studio keyboard mapper. (Tools -> Options -> Environment -> Keyboard) Introduce Variable... = "ReSharper.ReSharper_IntroVariable" Introduce Field... = "ReSharper.ReSharper_IntroduceField" Introduce Parameter... = "ReSharper

Is LINQifying my code worth accessing a foreach variable in a closure?

浪尽此生 提交于 2019-12-01 21:19:47
Reminiscent of the title of a bootleg live Rolling Stones recording of yesteryear, Resharper is sharper than I'll ever be; as I had it inspect my code, it told me this regarding closures: 1) "Loop: foreach (var item in PlatypiIds) { var query = db.Table<Locations>().Where(l => l.PlatypusId == item). Where(l=> l.SentTimeUTC >= EarliestToShow). Where(l=> l.SentTimeUTC <= LatestToShow). OrderBy(l => l.SentTimeUTC); if (query != null) { foreach (var q in query) { listLocs.Add(q); } } } ...can be converted into LINQ expression: listLocs.AddRange(from item in PlatypiIds select db.Table<Locations>()

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

六眼飞鱼酱① 提交于 2019-12-01 20:35:12
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 actually search for a type which inherits something, but my issue is that the only thing I actually have a

Problem with SQLite related nUnit-tests after upgrade to VS2010 and Re#5

我与影子孤独终老i 提交于 2019-12-01 20:26:10
问题 After converting to Visual Studio 2010 with ReSharper5 some of my unit tests started failing. More specifically this applies to all unit tests that use NHibernate with SQLite. The problem seem to be related to SQLite somehow. The unit tests that does not involve NHibernate and SQLite are still running fine. The exception is as follows: NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.2.4000, Culture=neutral,

Problem with SQLite related nUnit-tests after upgrade to VS2010 and Re#5

你。 提交于 2019-12-01 19:41:52
After converting to Visual Studio 2010 with ReSharper5 some of my unit tests started failing. More specifically this applies to all unit tests that use NHibernate with SQLite. The problem seem to be related to SQLite somehow. The unit tests that does not involve NHibernate and SQLite are still running fine. The exception is as follows: NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. ----> System.Reflection.TargetInvocationException : Exception has been thrown by

modified closure warning in ReSharper

隐身守侯 提交于 2019-12-01 19:36:31
I was hoping someone could explain to me what bad thing could happen in this code, which causes ReSharper to give an 'Access to modified closure' warning: bool result = true; foreach (string key in keys.TakeWhile(key => result)) { result = result && ContainsKey(key); } return result; Even if the code above seems safe, what bad things could happen in other 'modified closure' instances? I often see this warning as a result of using LINQ queries, and I tend to ignore it because I don't know what could go wrong. ReSharper tries to fix the problem by making a second variable that seems pointless to

Can not get Resharper Test Runner working with MS Test on VS 2010

不羁的心 提交于 2019-12-01 18:55:46
问题 I have recently upgraded to VS2010 Premium and Resharper 5.1.3000.12. Its test runner will now not execute MS Tests. The dialog shows up but nothing happens. So when opening \Bin\Debug\TestResults .trx file, I see a list of tests reported as not executed. They will execute fine if I click run from this dialog. If I click to view the 'Test run error' link I see the error message: "Failed to queue test run 'user@network date': The system can not find the file specified" Nunit tests work fine.

Can not get Resharper Test Runner working with MS Test on VS 2010

三世轮回 提交于 2019-12-01 18:04:05
I have recently upgraded to VS2010 Premium and Resharper 5.1.3000.12. Its test runner will now not execute MS Tests. The dialog shows up but nothing happens. So when opening \Bin\Debug\TestResults .trx file, I see a list of tests reported as not executed. They will execute fine if I click run from this dialog. If I click to view the 'Test run error' link I see the error message: "Failed to queue test run 'user@network date': The system can not find the file specified" Nunit tests work fine. Any ideas? Thanks Well, look like Resharper 6 does not have the issue. http://confluence.jetbrains.net

What sort of resharper specific files does resharper generate in your vs.net project?

China☆狼群 提交于 2019-12-01 17:38:05
What sort of resharper specific files does resharper generate in your vs.net project? (BTW, did you guys get the full version or just the C# version?) The "_Resharper.[Solution Name]" folder stores the Resharper specific cache. You can go to Resahrper > Options dialog and select "Store caches in: system TEMP folder" so that your solution folder is not cluttered. I personally prefer to use the TEMP folder so that the cache does not accidentally get added to the version control. Also, in case you want to clean the cache you can use the "Clear Caches" button on the Resharper Options dialog.