Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create an extension method using ReSharper?

I would like to Alt+Enter on the Update method below (it doesn't exist) to create a new extension method. Is there a way to do this in ReSharper?

List<FootyTeam> existingTeams = GetFootyTeams();
List<XmlTeam> newTeams = GetXmlTeams();

existingTeams.Update(xmlTeams);

(note, I'm new to ReSharper)

like image 586
atreeon Avatar asked Apr 07 '15 10:04

atreeon


1 Answers

I'm affraid this isn't possible at the moment ( even up to 9.1.3 ). There's the Static Method to Extension Method conversion, but not the refactoring you want.

Convert Static to Extension Method

This new refactoring converts a static method to an extension method. For the conversion to be carried out successfully, the static method must (1) have at least one argument and (2) reside in a static class. The reverse functionality is available with 'Convert Extension Method to Plain Static'.

Source: https://www.jetbrains.com/resharper/features/code_refactoring.html

like image 188
Jochen van Wylick Avatar answered Oct 04 '22 18:10

Jochen van Wylick