When I try to right-click on a block of code that I’ve selected, the only option shown is "surround with". I’m trying to do "extract method" on the code but I can’t seem to find the option.
I’m following a Unity tutorial. According to the tutorial, when I select this line of code, it’s supposed to show an "extract method" option but the only option that shows up for me is "surround with". I’m really new to this so any help will be very much appreciated.
2
Answers
Try shortcut key Ctrl+. or update VS
https://code.visualstudio.com/docs/editor/refactoring#_refactoring-actions
In
Visual Studio Code
(note thatVisual Studio
is a completely different software) you have to have according plug-in for according language(s).From https://code.visualstudio.com/docs/editor/refactoring
=> If you don’t have such option but someone else does (assuming they are indeed using VS Code) then they have an extension installed that you haven’t.
Here are a ton to chose from not sure of course exactly which one provides the
Extract Method
functionality