Visual Studio "Code" integration

Microsoft recently released its multiplatform code editor( https://code.visualstudio.com/ ). It seems promising especially for OSX users. It is native and fast. We would like to have this to be tightly integrated with unity.

On Unity side please vote here :

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

On Microsoft side please vote here :

http://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7752702-unity-integration

3 Likes

Likely wont happen since it dosnt support extensions like proper Visual Studio does, and that it dosnt work with solution files and operates more similar to a text editor than a ide

1 Like

If you are Windows user I understand. But the situation on OSX side is terrible. There are more and more developers that are just longing to get rid of mono develop. We have hack for sublime text, that works nice, but CODE would give us much nicer intelisense and debugging as well.

1 Like

Ya i know i live with that reality since at work since the target is iOS, so we are a mac shop. Most people are putting up with monodev and a few people like me are using parallels to run a windows VM and Visual Studio in seamless mode to get access to it.

I completely agree. Developing with MonoDevelop is an awful experience rife with bugs that never get fixed and poor debugging. Unity, please make this happen!

As an aside, does anyone know what address/port Unity uses to attach it’s debugger to MonoDevelop? There is an Attach option in the VSCode debugger and all it needs is that info. Maybe, just maybe, it’d work?

Unity seem to be partnering with Microsoft on a few things so wouldn’t be surprised to this working soon enough.

BTW Xamarin is a good free alternative to monodevelop and doesn’t really need any hacking just “sync Monodevelop Project” from the unity menu instead of double-clicking a script.

Hi Marek,

I saw you’re having the “Error: Failed to connect to OmniSharp” timeout in VSCode. I posted a possible answer on SO that might help - I had to hack around a bit, but it’s running now.

Best regards,
Shaun

Frankly, i was really excited about this, but after installing it on my OSX, i’m not really sure what is it.

VSCode seems more of an editor than an IDE.
I already have “intellisense” (e.g: code complete) in MonoDevelop, i’d like better debugging support, plugin ecosystem and other “rich” IDE features that are missing there.

It is possible of course these will be added in the future, but for now, I am less excited as i was when i saw the headline “Visual studio comes to Mac”…

Ya like a stated before it is more of a advanced editor similar to atom sublime text rather than a ide. Also it seems yo be targeting asp.net and node.js work at the moment so the tool was designed with web development in mind.

There’s a script up on Github that adds a drop-down menu in the unity top-bar for generating a VSCode-compatible .sln header file (or whatever).

If you’re having problems with Omnisharp and Mono versions, try downloading the latest version of Mono (Redirecting…).

I’m at the point where I can open my project, and Intellisense sort of works, but I get a ton of exceptions and seemingly all class references are broken.

1 Like

To correct a common misconception:

VS Code DOES work with solution files.

It just has a weird UI for using them. You need to open the directory which contains the solution files. Then you’ll notice a little button on the left side of the bottom bar with a flame icon. Click on that, and a menu will pop up at the top of the screen allowing you to select from the available solution files. As soon as you select one, the Intellisense turns on!

And another common misconception:

VS Code IS a full IDE.

It supports full project files, integrates directly with the build system, and provides a debugger. It even provides version control integration (though only git for the moment). If you were building a straight .NET application, instead of a Unity program, you could do all of that without leaving VS Code. The UI feels more like lightweight text editors, like Sublime and Atom, but it still has all the features that make a full IDE.

And another one:

VS Code is currently a PREVIEW release.

It’s not feature complete. I can’t say with any certainty what features will be in the “full” release, but I know plug-in support will be among them. See the top suggestion in Microsoft’s VS Code uservoice page, with official developer response: http://visualstudio.uservoice.com/forums/293070-visual-studio-code

Thus far, VS Code is proving far faster and more stable than MonoDevelop. Yes, MonoDevelop provides Intellisense, but it’s slow and buggy.

Yes, MonoDevelop provides a debugger, and sometimes, if the stars align and perform the appropriate incantations to the Ancient Dark Gods of Code, it even manages to hit breakpoints without crashing. And if you’re one of the True Chosen Ones, you might even be able to inspect variables, though I’ve never seen this.

And VS Code’s text editor is almost as good as Sublime, which is not something I can say of any fully featured IDE I’ve tried before.

Well…it’s really not that complicated to make Visual Studio Code work as the script editor for Unity3d, I wrote a little blogpost about it, as I can see many people are having problems with it.

This works for me, with Intellisense and everything. I haven’t tested if I can build from VSCode, debug or anything yet, but as a code editor it works perfectly! CMD+T is a pure winner. Press it and start typing class, property or method name you would like to goto - bam! :slight_smile:

If you’re on OSX <10.10 and get “Error: Cannot start Omnisharp because Mono version >=3.10.0 is required”, an alternative solution is to type that in a terminal.

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
brew update && brew unlink mono && brew install mono

(source http://brew.sh/ and macos - Can't start Omnisharp because of mono version - Stack Overflow)

There have been rumors of some upcoming tighter integration between Unity and Visual Studio. I’m guessing it will involve Code.

So after your post I gave Xamarin another go. It was terrible, I had a good laugh. From the “would you like to give feedback” popup that freezes the IDE, to typing inside the search field at the top right corner that also types in the script file so you probably use an old version of xamarin, don’t upgrade :wink:

I “solved” this exact issue (On OSX 10.9) by simply downloading the latest version of Mono. However, I’ve still been having problems (as I mentioned earlier), so I’m going to try this solution now.

Can you find all references of a class or public variable? Because I can’t. I’m still troubleshooting though – maybe there’s simply something wrong with my environment.

I can. It just worked, as soon as I opened the solution file.

Did you edit your solution file? I saw some people recommending that you change the 2008 to 2012, but that doesn’t seem to actually be necessary. Maybe that’s throwing something off?

I’ve haven’t experienced the problems you described but hey whatever floats your boat. You might want to give the 5.9 update a shot it was only released yesterday.

Has anyone worked out how to close a solution once opened?
Also how do we tell VSC not to show files like .meta in the explore list ? Or is that not where it’s showing me the files in the solution?

Edit: Am I correct that if there is any UnityScript in the solution, the solution wont load?

I just got it to work as expected on a Windows 7 machine, and it worked alright – as long as I opened the solution by double-clicking a code file from inside the project, as Laumania mentioned in his blog post.

Still, my project is seemingly full of exceptions (“Type or namespace name [somePluginClassName] could not be found (are you missing a using directive…)” yadda yadda), yet Intellisense and find all references/go to declaration works great.

MPowell, are you using OSX? (If so, what version of OSX, and what version of Mono do you have installed).

My next step is to make a new project and see if I can get that to work, error free, but I don’t have a lot of time for that today.