Reputation: 436
I have just now, finally upgraded to visual studio 2015 (from 2008..) Does anybody know where the refactoring context menu has gone?
Where is the "promote local variable to parameter"?
Where is the "extract interface"?
I'm searching google already for almost two hours and can't find...
here's visual studio 2008 refactoring context menu
EDIT: Thanks for help - but not yet the answer helping me..
Here's code I'm using:
var clr = pnlAnalysisParams.BackColor;
lbl.BackColor = clr;
When I'm selecting clr in the context menu - I'm getting only the suggestion to make it an inline var, BUT I was looking for the promote local variable to parameter...
under Edit/refactor I also don't have the kind of help..
Upvotes: 1
Views: 1371
Reputation: 7703
You can access it from Edit/refactor
, using light bulbs and also within the context menu. The last one is called Quick Actions and Refactor
.
The thing is that Visual Studio is more "context-aware", so it would only show the refactor options applicable to the code selected.
Edit
About "Promote local variable to parameter" this is said in this post talking about Visual Studio 2010:
Yes, this has been removed – we no longer support promote local for VS 2010 in the box, but we offer it as a free add-in that you can install on top of VS2010. The main reason for this was with the introduction of named and optional parameters in C# 4.0, there was a number of updates required not to break promote local. When deciding if we should invest more in supporting it, we looked at our SQM usage for this refactoring and it was significantly lower than the rest of our refactorings. We decided to put it into our new version of CodeRush Xpress (an add-in that we co-license with DevExpress) that includes a promote local refactoring that is surfaced through the VS smart tags in the same way that other refactorings are surfaced.
Upvotes: 2
Reputation: 4702
If you select the code you'd like to refactor, a small icon will appear in the right hand side bar that provides the same menu.
Upvotes: 0