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
Pictures
Dark theme as a window in Unity, needs work on the colours I think
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
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…
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.
I also accidentally deleted both the themes I already had…
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.
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
So I got a little distracted and built a pretty simple backup system into CodeEdit!
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