Visual Studio Code

A news story: Microsoft unveils Visual Studio Code For Mac, a cross-platform code editor for developers - 9to5Mac

Microsoft describes the program as a “code optimized editor” with support for Intellisense, debugging, and GIT. The developer tool also features integration with GitHub.

This is exciting news for me: Mac is my preferred platform for most purposes, and it’s easier to create iOS apps from a Mac OS X environment.

I’ve worked in Unity exclusively on Mac. However in my past life as a games industry programmer, I worked on Windows machines in Visual Studio. It was always a very powerful and reliable IDE with the most fully-featured debugger I knew, and a large selection of productivity tools.

I like Unity’s MonoDevelop more than most folks - I like that it has powerful refactoring tools and very good autocomplete, and deep customization for automatically following a coding style… and of course the debugger is a powerful tool, and on Mac the only way to attach to it is through MonoDevelop.

However, in almost every other respect, Unity-MonoDevelop on Mac is… well, it fucking sucks. It’s Bush League. It can be very fast and smooth at times, but it will often become sluggish and slow to respond, or will freeze completely. I’ve been using it since 2011 and only yesterday did I realize that when you open the “attach to debugger” dialog, you have to choose an option on the dialog within three seconds, and if you don’t, MonoDevelop will freeze and never recover. Unbelievable. I’ve talked to many developers who dual-boot, or work with Windows emulators, just so they can use Visual Studio with Unity from the Mac… but those options have never seemed practical to me.

The original creators of MonoDevelop, Xamarin Studio, have repeatedly said publicly that modern Xamarin has fixed almost all of these types of problems in the original MonoDevelop… and that all Unity had to do was pull their changes into their branch and bring Unity-MonoDevelop up-to-date, and the editor would be greatly improved. Yet I’ve never seen a Unity dev even express the intention of doing this. It literally feels like Unity doesn’t care about coders who work on Mac, and the fact that those coders have no really good options for code editors right now.

I hope Visual Studio Code will change that situation. At this point I’ve given up any hope of Unity taking the maintenance of MonoDevelop for Mac seriously - but if the Unity Editor can be integrated with Code on Mac, maybe I can finally have a good option for coding on my favorite platform.

I don’t have time to try Code just now, I’m behind on my current tasks… but I had to start a thread about this. (I’m behind on work in part thanks to MonoDevelop being constantly flaky, so I admit I’m venting about the situation a bit in this post.) But I hope to try this new editor, and look into hooking it up to Unity, within the next few days…

Until then, I thought I’d start a thread to discuss this, as I think it’s important! If you have a chance to try hooking them up, please post about it here, let’s share some knowledge!

2 Likes

Don’t waste your time. It’s barely more than a text editor. It doesn’t have Intellisense (at least insofar as Unity files are concerned) and its autocomplete is painfully unaware of its surroundings - it’s literally just a list of keywords that it has found in your file. It certainly doesn’t have the code refactoring or debug tools that MD has.

This discussion is better suited to the External Tools board.

It explicitly says that it has debugging and Intellisense. If Unity could integrate with those parts of the tool, and if Code has the small performance/memory footprint of a text editor, then it would already be an improvement on MonoDevelop.

I’ll try to figure out how to move this thread to the External Tools board I guess.

I think it has those things for Javascript/web dev. It doesn’t have any way to link up to the Editor process like MD can.

As for the performance/memory… well, there’s a reason I put up with those in MD, and it’s because of all of its extra features (which VSC very much does not have.)

“and very good autocomplete”
Really? MD’s auto is terrible for me.

1 Like

Why wouldn’t it? Visual Studio for Windows can connect to the Unity Editor process by attaching to the debugger. The editor explicitly has a section for connecting to an “External Script Editor” with a checkbox to allow it to attach the debugger to that tool. Seems it would be, at worst, some simple work for Unity to connect them together?

FWIW it looks like there’s already a thread for this (I didn’t see the External Tools board): http://forum.unity3d.com/threads/visual-studio-code-edition-mac-linux-windows.322373/

…I’m going to move this conversation there since people are already talking about hooking this up. Also this post seems to have a relevant poll: http://forum.unity3d.com/threads/will-visual-studio-code-replace-monodevelop.322354/#post-2091051

In any case, ignore this thread, sorry for missing that there was an existing discussion.

I’ll stop you right there. This thing isn’t Visual Studio.

This thing isnt Visual Studio, it is more on par as sublime for the kinda role it plays. It also is no good for Unity Dev, since it dosnt support Visual Studio Extensions to no debugger attaching and it dosnt seem to be aware of the Unity API and cant auto complete for it.

If you really want Visuals Studio Community or Pro on OS X i would recommend you use paralleles to make a windows virtual machine and run VS in that.

I have had great success doing so from OS X by keeping my project in a shared folder, and letting the debugger attach via a udp port on the lan.

Incorrect - see this post here for how to attach your -csharp.sln file: http://forum.unity3d.com/threads/will-visual-studio-code-replace-monodevelop.322354/#post-2091269

The only thing missing is proper integration with unity debugger – if Unity or MS can add this, Monodevelop would be dead in the water

1 Like

Seems like a logical next step, currently I develop on a pc then push to a mac and build from there because using monodevelop is terrible. Unfortunately I still have to use monodevelop some when I have errors on the mac build. I tried out Visual Studio Code earlier and it can’t even open a .sln so I’m not holding my breath.

Please vote here : http://feedback.unity3d.com/suggestions/visual-studio-code-integration

I just found a tutorial about using vsCode in unity3d at this time.

4 Likes

@big_march this was exactly what I needed! Your linked video had me up and running on the mac in under 5 minutes. Thank you so much!

You’re welcome:)
At this time, this is not perfect, as all files(meta, asset, mesh, texture) in unity project paths would be included in vsCode.I’ve not found a better way yet.I think customizing any plugin of vsCode would solve this problem.I’m looking forward someone to share this.

It’s still too bad vsCode doesn’t automatically fix stuff like missing ‘using’. This is something I use a lot in Xamarin Studio (newer version of MonoDevelop). I love the lightweight feel, but I need this for it to be chosen over Xamarin. And I’m not sure this will be a feature for vsCode.

btw. one plugin here,
“Unity3D editor plugin to make Unity projects Visual Studio Code compatible and add Unity/shader syntax highlighting”

1 Like

I think this is possible without a plugin, right?

Debug a Visual Studio solution in Visual Studio Code on OSX

http://blog.denouter.net/2015/05/in-my-previous-post-i-showed-how-to.html

Great! vsCode works perfect with Unity in CSharp, the auto completion is just working great!
But what about Javascript? anyone knows how to configure the vsCode to recognize .js.

It will never properly support what unity calls JavaScript since what unity calls js and what js really is are too very different things. Pretty much would have to wait till vs code supports extensions than wait for a unityScript plugin