Search Unity

CodeEdit IDE for Unity

Discussion in 'Works In Progress - Archive' started by Jamster, Aug 26, 2015.

  1. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    So for a while I've been attempting to make my own IDE thing that can run inside Unity. It's a pretty big task so it's progressing slowly but I thought I might share my progress with everyone and then I can get feedback as I go along :)

    So far implemented:
    • Syntax highlighting for C# (keywords only)
    • Syntax highlighting for XML
    • Loading by double clicking the script in the hierarchy
    • Themes!
    • Multifile editing via different windows
    • Basic Copy/Cut/Paste/Home/End functions that weren't already there
    Partially implemented:
    • Loading from the console window (it loads the file but doesn't jump to the line for some reason)
    • Zoom (it's err. broken again...)
    Next job is to keep fixing bugs and to use reflection to improve the syntax highlighting and add an autocomplete :)

    Dark theme as a window in Unity, needs work on the colours I think :p
    CodeEditDark.PNG

    Example of the light theme in full screen mode illustrating loads of different colours. CodeEditLight.PNG

    Themes can be altered in the inspector and then easily set as the default to use. CodeEditTheme.PNG

    I don't know where this is going, maybe I open source it, maybe I sell it on the asset store but I think there's a good chance it'll be available for free if I finish it because I don't think anyone wants to have to use Monodevelop :p

    Jamie
     
  2. Patico

    Patico

    Joined:
    May 21, 2013
    Posts:
    886
    Looks good. Is the import/export of highlighting settings (for example for sharing one theme between some workstations)?
     
  3. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Think so! The themes are stored as ScriptableObjects so as far as I know they can be shared :)

    If it turns out it doesn't work I'll just stick them in XML format :)

    EDIT: When you open a file from the console it now jumps to the right line :D
     
  4. TheDarkBadger

    TheDarkBadger

    Joined:
    Feb 7, 2015
    Posts:
    27
    Looks pretty cool, really should be something in Unity by default, any ideas on a release date?
     
  5. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Gah I don't know... it's not small and nowhere near complete :(

    There's glitch after glitch in it because Unity wasn't designed for some of the ways I'm using it here, I just noticed that when you dock it it seems to muck up some completely unconnected code and causes editing to go bizarre...

    The best estimate I could tell you is next year :(
     
  6. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    A couple of bugs have been fixed now and I've remade the themes system a little to allow for different settings for different file types. Having said that, at some point it would probably be sensible to completely redo it.

    I've also added virtual whitespace but I need to make a couple of alterations so it aligns tabs to a grid.

    Theme.gif
    I also accidentally deleted both the themes I already had... :(
     
    TheDarkBadger likes this.
  7. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    We have virtual whitespace!
    VirtualWhitespace.gif

    I also now have a mocked up autocomplete GUI you can scroll through and insert stuff from! I'm a little hesitant to say it's final because it's not pretty and it's also fairly roughly coded so I wont show it. Really the whole project needs to be rewritten modularly at some point though.

    Finally I have some helpers written for any refactors/autocompletes to aid in reading the .csproj files Unity generates.

    And I remade both the themes...
     
  8. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    I've now refactored a large portion of the window code to use a few more files, it previously had everything vaguely window related in a single file that was bordering on 1000 lines! Now it spreads out the autocomplete window/menu bar/and the basic editor code a little so it's more modular and less spaghetti. It'll also be a good basis if I ever want to add other windows or allow plugins etc :)
     
  9. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    So I got a little distracted and built a pretty simple backup system into CodeEdit!
    CodeEditBackupWindow.PNG
    You can easily set it to make a backup every time you save and set it to periodically make backups while the file is open. There's also a lovely large backup button on the editor :)

    Now I guess I have to work on the autocomplete!