Where the hell is the Extract mode in Visual Studio ? :D

Hello everyone,
I am following Unity 2D developper and during the lesson, the coach is asking to extract a part of the selected code pushing I don’t know which buttons I don’t have on my laptop…
So I right click on it and I found “refactor” which after some google search is the first step to extract a method.
So I click on refactor and “extract” should appear but is not… On my laptop I see “surround with” and under (“more”) if I click on it and try in the search bar to write “extract” nothing…



I searched on the forum here on gamedev and I am not the only one to face that problem but the answers I tried reading forums did not succeed. Maybe I did wrong…

My “External Script Editor” in Unity is "Visual Studio Code (internal). I don’t know why mine is (internal…). (I think informatic gods hate me) :flushed:

Also I don’t have the same color from keywords and the proposals to create methods or variables from Visual Studio are less than the coach on the lessons. So I think my problem comes from Visual Studio.

Maybe I have mutliples extensions which are creating problems between them.

I love these lessons, and I want to keep going on. HELP !

Hi HotsauceHouse,

Thanks for sharing so many screenshots which show the problem in detail. That’s helpful. :slight_smile:

There is very likely something wrong with the installation of VS Code. Unfortunately, this is a quite common problem. Even if you installed everything correctly, VS Code still might not work properly.

Please follow the instruction on this website and make sure all required extensions are installed: https://code.visualstudio.com/docs/other/unity

If VS Code still does not work properly, uninstall and reinstall it.

And if that didn’t help either, consider using Visual Studio (Community Edition). If you want to give it a try, please follow this instruction.


See also:

1 Like

Thank you Nina !

I think I found and it was very stupid.
On my computer I had 2 Unity installed, I don’t know how this happend and did not bug before, but I had a 21 version and a 22…
I had also to update Visual Studio Editor, but when I did this, it did not work instantly, 5 minutes later it allowed me to extract…
Now the color of the keywords are the same as the lessons in Visual Studio.
Well problem fixed. :smiley:
Thanks again !

I’m glad updating the Visual Studio Editor (you mean the package, don’t you?) fixed it for you. :slight_smile:

1 Like

Yes I updated the package. :slight_smile:
Later in the lesson they asked to generate a method, but on my Visual Studio it does not appear too…

Argh!
:persevere:
If you have an idea about that, I will be happy.
Thank you Nina.

Try ‘Extract local function’. That sounds as if VS Code might generate a method. If that didn’t work, don’t waste your time looking for the function but create a new method manually. We don’t use the shortcut that often anyway.

Alternatively, you could try to reinstall VS Code and all extensions. Maybe that’ll fix it.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms