Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Will Visual Studio Code replace MonoDevelop

Discussion in 'General Discussion' started by HRoland, Apr 29, 2015.

?

Do you want this to happen as well? :)

  1. Gimme, gimme, gimme!

  2. Why not?

  3. I don't care.

  4. I'm fine with MonoDevelop.

  5. Don't you DARE replace MonoDevelop!

Results are only viewable after voting.
  1. Ox_

    Ox_

    Joined:
    Jun 9, 2013
    Posts:
    93
    I wasted half a day trying to setup it for C# + Unity. Auto-completion plugin was constantly crashing. We have a separate ST thread on this forum where many other developers experienced some issues with a Unity+ST setup.

    So I want to have a complete solution by MS/Unity rather than a dozen of plugins made by 3rd party developers.
     
    angrypenguin and IQpierce like this.
  2. IQpierce

    IQpierce

    Joined:
    Jan 24, 2011
    Posts:
    43
    Does Sublime even have support for auto-code-generation/refactoring stuff?

    My favorite thing about MonoDevelop is that it has decent tools like those to automate some common needs:
    • "Generate method" - I can type out a method call to a method that doesn't exist, then basically hit a button and make the method exist as a stub that I can fill in (including automatically declaring the parameters I'm passing in).
    • A nice context menu to automatically generate overrides of parent functions, and implementations of functions required to implement an interface.
    • Renaming a variable/property/method globally - I know Sublime can do this across an entire file, but can it properly find all the references to a variable and rename them? It seems like you need Intellisense or some other way of the editor being aware of the context. Being able to properly rename things trivially is important IMO, because it lets you constantly improve your code (renaming poorly-named methods etc) without slowing yourself down.
    VS Code doesn't even seem to have any of these features except the last one, so I'll miss them if I ever do switch over.

    Honestly, if MonoDevelop would stop doing a few specific dumb things (launching slowly; chugging/freezing for no apparent reason at random times; freezing/crashing half the times I try to attach the debugger), then it would be one of my favorite coding environments of all time.

    But improving or maintaining MonoDevelop seems to be at the absolute bottom of Unity's list of priorities. Even if VS Code doesn't have these capabilities out of the box, it's likely to be much better supported (and/or have a more active plugin development community) than Unity-MonoDevelop has.
     
  3. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    I know, right? Too bad Unity Tech doesn't like to make such surprises...
     
  4. Torninator

    Torninator

    Joined:
    Jun 17, 2014
    Posts:
    11
  5. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,773
    Thanks for that guide. I went back and reevaluated it using this, and it does become drastically smarter after.

    With that in mind, the big apparent shortcoming is now basically an annoyance: is there any way to move the cursor by eachWordWithinAVariableName like how Ctrl-left and right (and backspace and delete) behave in MonoDevelop?
     
  6. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    But VSC is severely limited, isn't it? Clicking on Debug.Log statements or errors in the Console take you to the correct file but not to the corresponding line in the file.
     
  7. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    That's an integration issue, not a VSC issue, so with all of this "partnership" stuff Unity and MS keep going on about I expect that it'll be improved by the time Code is out of preview.

    Remember that VS Code is being pitched as a code-oriented text editor, not a full IDE. There's VS Community for that, though it's only on Windows.

    Unity's MonoDevelop used to be pretty good. From memory, the main issue with it is that its integration with Unity is implemented as a branch rather than a plugin, making maintenance much harder than it could be. The result is that advancements and/or fixes to the main MonoDevelop project don't make it to Unity's version for ages.

    Unity could potentially fix that, of course, but my gut feel is that Code seems to be a better fit anyway.
     
    Last edited: May 1, 2015
    Robota and Dustin-Horne like this.
  8. Ox_

    Ox_

    Joined:
    Jun 9, 2013
    Posts:
    93
    Haha, I didn't know about this because the feature isn't present in Preferences -> Key Bindings!

    MonoDevelop is a giant mess. Send the UserVoice voting link to all your developer friends!
     
  9. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
  10. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    I had this work once on Mac. I've tried it three more times since, and always get this:
    ... and this:
    Not sure if it's me missing something, an issue with Code/OmniSharp or an issue with the project file. Anyone else getting it?
     
  11. Ox_

    Ox_

    Joined:
    Jun 9, 2013
    Posts:
    93
    Ghopper21 likes this.
  12. Ghopper21

    Ghopper21

    Joined:
    Aug 24, 2012
    Posts:
    170
    Thanks -- that is a good read. I finally understand why the settings are erratic with Xamarin, which otherwise is very good. The sln cruft remover script the Prime31 provides sounds really helpful.

    (In fact I wonder if that cruft has anything to do with some of the problems I have getting omnisharp-vim to work completely reliably with Unity solutions.)
     
  13. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Well Code is a mistake if the regular VS IDE doesn't seamlessly and correctly integrate right over the top of Code; i.e. when you install VS Studio 2015 Ultimate at it's core is the VS Code install packages.

    And either is better than MonoDevelop.
     
  14. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @goat I think the whole point of VS Code is to be a multiplatform IDE, so the regular VS is out of the game. Also if you already have VS Ultimate there's no need to use VS Code... well unless you want a lightweight editor for some quick changes... But then again, if VS Code would integrate with the regular VS it wouldn't be a lightweight editor anymore.
     
  15. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    No I didn't. There is no reason why software switches can't handle platform specific linking. Code need to be such that is Windows Platform libraries are cross Windows device compatible and so it needs that Code be a subset of VS Community.

    While Apple may never allow apps to be linked and published on a Windows platform, Windows apps should be allowed to be linked on published on an Apple platform. And so with that Code should be a subset of Community, or rather more accurate two intersecting sets but if should that intersection should always be compatible across all Windows devices.

    It does not need to become the new Unity version of MonoDevelop.
     
  16. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    Hopefully it'll end up this way, but since (for now) they're two different tools with two different goals and one of them is only just starting it's first version now I don't see why it necessarily needs to be that way out of the gate.

    My guess at this stage is that some future version of VS will use Code's text editing stuff as its text editing stuff, and all of the other tools that make it a full IDE (instead of a text editor with some code tools - which is all Code claims to be) will gradually be ported or replaced with cross-platform versions. I wouldn't really expect them to do all of that at once.

    Why are Apple and MS being held to different standards here? MS have only very recently started supporting their own stuff on other platforms - in the past it's almost all been done by 3rd parties.

    Also, if I remember correctly MS owns half of Apple, not the other way 'round. So if one has to dance to the other's tune...

    Of course you need to have something to link against...
     
  17. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    517
    Sorry to be off topic, but this myth about Microsoft/Apple really bothers me. Here is some education about the investment you are referring to.
    http://www.engadget.com/2014/05/20/what-ever-became-of-microsofts-150-million-investment-in-apple/
    tl;dr Microsoft currently doesn't own any shares of Apple. Please stop retelling this urban myth and educate others that claim this as well.Thanks!

    In regards to visual studio code, it seems that it is missing some features I would like in my code editor. I use Xamarin for Mac Unity development. Even with all of the quirks and no debugger it is a better experience than writing code in Monodevelop that is shipping with Unity.
     
    Last edited: May 10, 2015
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    That's why I said "if I remember correctly". ;)

    For those interested, the relevant part of the article is as such:
     
  19. Moonstorm

    Moonstorm

    Joined:
    Jul 26, 2012
    Posts:
    23
    I ran into this. Here's how I fixed it:

    On Terminal in OS X, use the following commands:

    brew tap aspnet/dnx
    brew update
    brew install dnvm

    Full instructions are here: https://github.com/aspnet/Home/tree/glennc/readmelove
     
    angrypenguin likes this.
  20. Moonstorm

    Moonstorm

    Joined:
    Jul 26, 2012
    Posts:
    23
    FWIW I have fully switched over to Code. It's far better to live with as a code editor, and the code complete works great, and the git integration is pretty slick too.

    I do not debug with it and I miss the auto-generated snippets for delegates and events. But aside from that, way faster and nicer to work with than MonoDevelop.
     
  21. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Any chance you can give an overview of the steps required to use Code with Unity and have code completion etc working?
     
  22. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,773
    It was posted in another thread about this, but the gist is:

    Open new VSC window.
    Click the "files" icon (top left).
    Click Open Folder, and choose your project folder (the one that includes your Assets/Library/etc)
    Wait a couple of seconds for it to check out the folder
    You'll see a little flame icon appear near the bottom left of the window.
    Click that, and choose your "whatever-CSharp.sln" file
     
    larku and angrypenguin like this.
  23. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    I've always used mono develop more as a basic text editor than as a full ide. I use unity's console for most of my debugging. I'll give vs code a try over the weekend, and see how it works on my Mac and Linux boxes.
     
  24. cl9-2

    cl9-2

    Joined:
    May 31, 2013
    Posts:
    417
    Is there a way for VSC to open a script and then recognize through its parent folders that it belongs to a project?
     
  25. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    Maybe in the future. Remember it's an unfinished preview at the moment. Also consider that it might not be as easy as it sounds, since there could be multiple projects and/or solutions that could potentially fit.
     
  26. pjezek

    pjezek

    Joined:
    Jun 10, 2009
    Posts:
    18
    Thanks to this tread I will stick to MD on Mac and VS on Windows...

    I have one correction to the blog post from prime31 (which is a very nice blog post btw ;) ):

    You can use Xamarin Studio to debug (At least with Unity4), all you need is to read the blog post from Clifford M. Roche.

    Here are the direct links to the add ins reposistory:
    - Unity shader, cginc, and glslinc files
    - Soft Debugger (only MonoDevelop 4.0)
     
    Ox_ likes this.
  27. UCh

    UCh

    Joined:
    Nov 18, 2012
    Posts:
    29
    Unity released an addOn for the latest Xamarin. I did a quick try and works fine. Take a look to this thread http://forum.unity3d.com/threads/unity-add-ins-for-monodevelop-xamarin-studio-5-9.329880/
     
    Ox_ and pjezek like this.
  28. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
  29. pjezek

    pjezek

    Joined:
    Jun 10, 2009
    Posts:
    18
    Just tested the plugins from beta channel with latest Unity and latest Xamarin. They seem to work as expected.

    @UCh thanks, will check them out.
     
  30. johnsteinberg

    johnsteinberg

    Joined:
    Jan 12, 2015
    Posts:
    26
    Awesome thread guys!

    Has anyone figured out if you can hide the .meta files in VS Code? It is a small irritation I know, but if there is a way it would be cool.
     
  31. johnsteinberg

    johnsteinberg

    Joined:
    Jan 12, 2015
    Posts:
    26
    With the release of v0.5.0 you can now configure your settings to exclude certain files from the folder view. By the way, they mention Unity a couple of times in their release notes which is quite encouraging.

    For anyone who wants to exclude .meta and .cs.meta files from view, do the following steps after you updated to the latest version of VS Code:

    1) Choose Code -> Preferences -> User Settings (this will change the setting globally for all VS Code sessions):



    2) In the right hand pane which contains your user settings overrides, add the following snippet:



    3) Save the file

    Code might popup a message at the top saying that it needs to restart, click restart and .... voila!! No more .meta and .cs.meta files in the file explorer window.

    I like where they are going with this.
     
  32. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Thank you very much for this tips !
     
  33. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Anyone else found with the latest version it always loads a script in a new window? (Unity - > double click on script -> new VSC window). Previously it would open the script in an already open project.
     
  34. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @gonzorob Add -r to the command arguments, that should fix it.
     
  35. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Sorry for being slow, there's no setting for that in External Tools. Is it a VSC setting? If so, cant find it in the Settings
     
  36. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    No, it's in the External Tools. Set External Script Editor Args to
    Code (csharp):
    1. -r -g "$(File)":$(Line):0
    This works for me at least.
     
  37. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Looks like that's a windows only feature. Ive tried using this trick :

    http://wiki.unity3d.com/index.php/Using_Sublime_Text_as_a_script_editor
    But with a bash file
    Code (csharp):
    1.  
    2. #!/bin/sh
    3.  
    4. # Change '/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron' to the path to your executable of Visual Studio Code.
    5.  
    6. /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron -r -g $1:$2:0
    7.  
    8. echo "Opening '$1' on line '$2' with Visual Studio Code"
    9. exit 0
    10.  
    To get Unity to recognise the script you have to change the extension to .app (http://forum.unity3d.com/threads/external-script-editor-what-apps-are-allowed.8073/)

    Sadly, no joy. (VSC loads, just without the file) Perhaps it's my script ? I'm awful at bash...
     
  38. CapnCromulent

    CapnCromulent

    Joined:
    Sep 7, 2010
    Posts:
    45
    I ran into the same problem. I don't think it's your bash script; I think the tutorial is wrong, or at least outdated.

    There was a post from Joachim Ante who said that Unity on OSX uses AppleEvents to transmit the line number. A couple guys in the SublimeText thread built a simple app to catch the event; I adapted their code to work with VSC here:

    https://github.com/CapnCromulent/VSCProxy
     
    bvesco and angrypenguin like this.
  39. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    I voted for "Don't you DARE replace MonoDevelop!".
    Don't get me wrong, I think Visual Studio Code is awesome. I tested it about a week ago and it's super fast which I like very much! The only things keeping me from using it is the absence of custom syntax highlighting colors and the fact that I didn't find an option to turn off those lines that tell me how often methods are referenced.
    But anyway, I don't think MonoDevelop should be completely replaced. It has been there for quite a while, while Visual Studio Code doesn't even have a release yet. At the bottom line, I think both should be an option.
     
  40. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    There's a preference for it. You can search for reference in the preferences and you should find it easily.
     
  41. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Found it! Thank you very much for this information! Alright, now I'm switching to VSC as soon as custom syntax highlighting arrives!
     
  42. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
  43. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    That looks promising! However, I don't know how to create my own theme data that I could feed Code with.
    EDIT:
    Also, I can't find a corresponding path on Mac OS.
     
    Last edited: Sep 2, 2015
  44. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @Shushustorm Just out of curiosity, what is the custom theme you wanted to add?
     
  45. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    I would actually like to make my own theme just like it can be done in MonoDevelop. I don't really fancy most of the themes that are available by default.
     
  46. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    New version available now: 0.8
    https://code.visualstudio.com/Updates

    Also, does anyone know if I can change something in the settings to get this behaviour?:
    In MonoDevelop, when I write
    Code (CSharp):
    1. this.gameObject.get
    and then press <
    it will automatically complete it to
    Code (CSharp):
    1. this.gameObject.GetComponent<
    Just like when writing "pub", pressing space, then "gam", pressing space, and you have:
    Code (CSharp):
    1. public GameObject
     
    Last edited: Sep 11, 2015
  47. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    so... Monodevelop doesnt work right with Unity 5.2 huh?
    whenever i open a script with Monodevelop it says "could not load project file .. blah blah etc"

    iam REALLY used to Monodevelop now... guess ill stick with Unity 5.13 ?

    LOL weird, now it just works.. i dont remember what i did.. other day i reinstalled VS, guess it did something else or something?? lol idk
     
    Last edited: Sep 12, 2015
  48. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Weird. While working in the beginning, I had some problems with using VS Code 0.8 in some projects.
    The IntelliSense didn't work. I thought I might be able to work with the Abyss theme, but I certainly won't use it if it's unreliable. Also, the problem stated in my last post.
    I switched back to MonoDevelop for now, which, for me, hasn't caused any problems in Unity 5.2 so far.
     
  49. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    I had a problem on 0.7 like that. Seems to be fixed with 0.8, although I haven't been using it.
     
  50. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    I hate Visual Studio, if it is ever straight forced I'll switch to another engine.
    I hate how Visual Studio Autocompletes everything when it's something I don't even want, I do however, like
    how it pops the choices up like mono, but to forcibly choose the one I don't want if I press a certain key, I hate it.

    I'm sure I could cut that off, but I ain't got time to learn something when mono works perfect for me every time.
    I have no reason to want to switch. VS loads in like 2 minutes, mono loads in like 5 seconds.