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/f...io-code/suggestions/7752702-unity-integration
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
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.
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. http://stackoverflow.com/questions/29958989/getting-error-failed-to-connect-to-omnisharp 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). https://github.com/kode80/VSCUnity If you're having problems with Omnisharp and Mono versions, try downloading the latest version of Mono (http://www.mono-project.com/download/). 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.
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. http://laumania.net/2015/04/30/how-to-use-visual-studio-code-as-unity3d-script-editor/ 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!
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 http://stackoverflow.com/questions/29959239/cant-start-omnisharp-because-of-mono-version)
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
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.
By "from inside the project" you mean "in the Unity editor"? That's odd. I'm not sure why that should matter. Edit: Wait, opening the SOLUTION from inside the editor? How is that possible? Even Laumania's blog post doesn't describe doing that. You need to open the solution by opening the right folder inside VS Code, and then clicking the little flame button at the bottom. seon has an interesting point: Does your project include any JavaScript/UnityScript or Boo? VS Code isn't going to know how to deal with that properly, and may throw up some errors. I'm using OS X 10.9, with Mono 3.12.0.
Nah, double-clicking a script from inside Unity. Sorry for the confusion. I've also tried opening the root folder of the project, and then using the flame icon to select the correct solution, but that produces the same error for me on OSX and just doesn't work on Windows (and I'm sure I'm doing it right and opening the correct solution, if it even matters). I thought of this too, and systematically purged every .js file in the project (all from plugins or standard assets -- we weren't using any of them anyway). I didn't need to do this to get things working on Windows. Let me try with a fresh project and see what happens. EDIT: Fresh project looks good (on OSX); no issues. It's probably a plugin in our project causing issues, but I'm not sure what or why. Still, there are a few weird warnings, like "Unnecessary using directive" for the line "using System.Collections" which comes default with a new script. In my actual project, pretty much every occurrence of using [something]; produces this warning. On top of the countless errors about missing references that aren't actually missing. EDIT 2: Made a javascript file. Doesn't work at all, on either OSX or windows. Doesn't recognize the syntax.
Those are unnecessary, unless you're actually using a type from System.Collections. Which I basically never do. All the useful collection classes are in System.Collections.Generic. I have no idea why Unity includes that using directive in new files.
Well reinstalling Xamarin on OSX helped to solve error with OmniSharp just for the first time. Second time I opened VSCode is is getting back to Error with omnisharp. Any idea?
I switched from Visual Studio Pro to VS Code. Love the light-weightedness of the editor and it does everything you need minus the extra baggage.
Ah.. so it's complaining because I'm not using anything from it. Makes sense. Yeah it seems pretty rad, but I'm going to have to stick with Visual Studio through a VM using UnityVS until I have something that works consistently. I use debugging heavily, which works perfectly in VS for me but hangs up Monodevelop half of the time I try to attach. Part of the reason I'm on OSX is because I want the tools I use to "just work," and this isn't quite there (obviously it's a preview and every Unity person who's spoke about Code hadn't heard of it until yesterday, so it makes sense).
I wrote the VSCUnity script (https://github.com/kode80/VSCUnity). Aside from removing the need to manually choose the correct SLN each time you open the project, I've also just added Unity type syntax highlighting as well. Just add the script and run the two commands in the VS Code menu. Project update command will need to be run per-project. The Add Unity Types to VSC command only needs to be run once (as it updates VSC's internal C# language definition). IMO - Visual Studio Code is a million times nicer than MonoDevelop, even in it's earlier state. It's faster, infinitely more stable and code comfort in general is great - so I'm eager to see Unity integration brought up to speed.
I first tested out Kode80's plugin by starting a new project and didn't have that issue. But when I tried to integrate Kode80's tools with my current (large) project, I got this error as well :/ Please note that this error appeared after I clicked the Flame Icon and selected my .sln file.
i fixed that error by removing spaces from (moving) project folder name if you open the log and select OmniSharp you can see exactly why it fails
My project folder name has no spaces, so I don't think that's the issue. After doing some tests, it seems to be based on the size of the project. At a certain point, if I import any more assets from the asset store, Visual Studio Code gives me that error. How do I open the log to see exactly why it fails? Is that file stored somewhere?
ctrl-shift-u or view->output or search log in pallete ctrl+p then select omnisharp from the dropdown in top right of output window
Ok, I fixed my OmniSharp error by hand-modifying my .sln files through trial and error. Adding this section to the end of them seemed to do the trick: Here's the easy-to-copy-paste version: GlobalSection(MonoDevelopProperties) = preSolution StartupItem = Assembly-CSharp.csproj Policies = $0 $0.TextStylePolicy = $1 $1.inheritsSet = null $1.scope = text/x-csharp $0.CSharpFormattingPolicy = $2 $2.inheritsSet = Mono $2.inheritsScope = text/x-csharp $2.scope = text/x-csharp $0.TextStylePolicy = $3 $3.FileWidth = 120 $3.TabWidth = 4 $3.IndentWidth = 4 $3.EolMarker = Unix $3.inheritsSet = Mono $3.inheritsScope = text/plain $3.scope = text/plain EndGlobalSection
Has anyone tried using the platform dependent codes? Meaning the #if UNITY_EDITOR and such. Seems to me that VSCode understands the #if part but not the UNITY_EDITOR.
Here's my current system for keeping VSCode functioning with Unity. This has been tested against the upcoming VSCode release, as well as future versions of Unity. https://gist.github.com/reapazor/132abf1e7efc317d9e15 It's not pretty, it just gets the job done. No highlighting ... I suppose I could do something about that, but meh
If you're struggling to get the new "-r -g" parameters working on OSX, I've added an app that handles it for you: https://github.com/CapnCromulent/VSCProxy It's based on SublimeProxy that does the same thing for SublimeText.
Shader syntax highlighting isn't included in the plugin, which I should add is getting some love from the Visual Studio Code team shortly. I've actually just moved it to a repo on GitHub: https://github.com/dotBunny/VSCode I've also submitted a copy to the UAS, still hasn't been approved but its link is: http://u3d.as/jmM Hopefully the USA link is active soon.
Microsoft have Unity integration under review now: http://visualstudio.uservoice.com/f...io-code/suggestions/7752702-unity-integration Good things might be on the way.
Has anybody been able to use VSC 0.9 IntelliSense with Unity 5.2.2? When opening a project, I will get a warning message that says "Some projects have trouble loading".
Have you checked out the Consulo IDE? https://github.com/consulo/consulo I can't compare it to VSC as I haven't tried the latter, but personally I prefer Consulo way over MonoDevelop. It is based on the Intellij Community Edition so if any of you like the JetBrains IDE's you should definitely give it try.
would seem this thread missed the announcement: http://forum.unity3d.com/threads/vs-code-unity-debugger-extension-preview.369775/
@shaun Hi shaun, While using vscode to create a brand new simple console app (HelloWorld) even the one and only using System directive is underlined with a green squiggly! I wonder if you have come across this? I am confused by all the posts and search results... My dotnet version is 1.0.0-preview2-1-003177 and this line "version": "1.0.0-*" also exists in the project.json file. I wonder if you would know a hack around this? Thanks
Hover over the green squiggle and it will tell you what it means. I think it just means that you do not need that using statement ("unnecessary using directive")? Which means it is working, and understands your code enough to know that.