CodeEdit IDE for Unity

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 :slight_smile:

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 :slight_smile:

Pictures

Dark theme as a window in Unity, needs work on the colours I think :stuck_out_tongue:

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

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

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 :stuck_out_tongue:

Jamie

Looks good. Is the import/export of highlighting settings (for example for sharing one theme between some workstations)?

Think so! The themes are stored as ScriptableObjects so as far as I know they can be shared :slight_smile:

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

EDIT: When you open a file from the console it now jumps to the right line :smile:

Looks pretty cool, really should be something in Unity by default, any ideas on a release date?

Gah I don’t know… it’s not small and nowhere near complete :frowning:

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 :frowning:

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.

2271492--152255--Theme.gif
I also accidentally deleted both the themes I already had… :frowning:

1 Like

We have virtual whitespace!
2279165--152997--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…

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 :slight_smile:

So I got a little distracted and built a pretty simple backup system into CodeEdit!
2293017--154257--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 :slight_smile:

Now I guess I have to work on the autocomplete!