UnIDE - A Code Editor Integrated Into Unity

I have been working on an IDE/code editor for a few weeks. It is specifically designed for use with Unity and integrated right into the Unity UI.

My goals for this project are to create a code editing solution for Unity that has all the features people want and use for day to day programming. I want this to be an alternative to MonoDevelop and Visual Studio, offering all the “must have” features of these and other IDE/text editors, such as:

  • Intuitive syntax aware text editing.
  • Context sensitive autocomplete/intellisense on par with Visual Studio.
  • Code Signature tooltips.
  • Find and Replace. with keyword highlighting.
  • Error and warning highlighting from Unity console data.
  • C#, UnityScript, and Boo support. (Boo and UnityScript support may be limited initially).
  • Quick navigation and search through your project to find the the files you need.
  • Collapsible side navigation bar with mouse-over expanding to maximize your programming workspace.
  • Extensibility, implements powerful plugin system. The autocomplete feature is implemented as a plugin.
  • Theme system to choose and customize the look of the editor.

Heres a sceenshot of the current state of the editor.
[Click for full size]

The last large features I need to finish up are autocomplete, code tooltips and Find/Replace. Besides that its just small features and additional UI stuff.

Some things I don’t plan on adding, at least initially are things that you don’t use day to day, such as large scale refactoring.

Id like to hear suggestions for features that would take advantage of the fact that its integrated into Unity and shares the same API. These things could be visual editing for datatypes like Color, and Vector2/3/4, or a code snippet evaluator for doing quick editor scripting tasks without dedicating a full class and file for the snippet.

I really thing this is awsome :smile:. Did you have any information on ETA and price?
Also a feauture that I´m missing in youre list ist Code folding and regions, that is somthing that I use quite a lot.
And is it possible to create new scripts from your site navigation?

I would like to get it finished as soon as possible. Hopefully within the next week or two. As far as price I’m not really sure. I want to say no more than $50 right now. I also may release a free “lite” version.

Code folding is definitely something that can be added. I don’t think this would be too much work. I do plan on adding the ability to create scripts from the navigation panel, probably with customizable code file templates.

Wow, this looks awesome. $50 would definitely be worth it.

Also, just a quick idea I had when I was reading would be a minimization type system. For example, when you click off of the code editor it goes into a sidebar then when you click back on it goes into the normal size. May or may not work. Just and idea.

Show this thing to UT, contact them and talk about having this built into the native editor; There’s no reason for UT not paying for such good extension, we all know all those IDEs are very buggy, if this tool at least doesn’t introduce MORE bugs than average is more than worth it…
But buying as external add-on, I wouldn’t pay much. $50 sounds a bit of to much when I already have 3 IDEs to work from.
I mean just “sounds” expensive, but I know that making such a thingy is not even close of being easy… But hmm, we already have IDEs :wink:

I feature that I really wish they would have is, when I have a function or other stuff, that should be added to the auto complete, so should private vars.

Awesome work. I was wondering when someone would develop something like this the other day, so I was happy to see this thread. It would be nice to have resharper support but I would only use this if it supported debugging. Without proper debugging tools, this wouldn’t add much value over Visual Studios/Monodevelop. I only say that because having a window inside the editor is nice but most of the time my IDE is open on a second monitor which is one click away. With this solution I would most likely tear the window off to a second monitor since writing code in a small window would be a pita.

-Dane

WOW, kurtloeffler that looks awesome! :slight_smile: Seems like you’ve already surpassed the state of my Script Inspector, congrats!!!

Looking at that screenshot, each letter look like sprites instead of simple text lines. Is that correct?
Complicated stuff going on there.
I like the coding style, looks almost the same of mine. Hate unnecessary empty lines, etc :wink:

Looks awesome. How fast is it? How fast does it load?

HOLY! I always wanted this, man!

Would only consider it if it had source level debugging.

UT was already(or planning to) developing something very similar to this… This is nice, but I wouldn’t buy this I already have VS and Mono Develop, I would however donate to you for developing such a tool…

Here is something I would take into account.
I think the unity editor is already pretty crowded for smaller screens(I have 1024x768 laptop screen) with the hierarchy,project panel, inspector, scene and game window this is just another thing cluttering it up, It could get pretty messy. I dunno if I’d prefer to switch tabs(inside unity) or windows(outside of unity) im not certain but I think you should try to make this clean looking as possible so people would want to use it and not have to worry about cluttering things up. so far its interesting.

Yea, I pretty much feel the same. It is a great idea, and if it was solid and quick, it might be nice for a quick edit here or there, but really hard to justify paying for yet another text editor. I someone else said, I would probably donate just because it is cool.

I do think though, that it could be successful, especially if there was a way to extend/script for it. There are many folks just getting into programming and who, uh… erm… aren’t religiously dedicated to their tool of choice. (like me) :wink:

This looks fantastic.

This is a good suggestion, I will definitely look into if programmatically resizing docked windows is possible, although I have a feeling its not, or may cause strange stuff to happen to other docked windows. I also want to look into using a global hotkey to show and hide the window so it could be docked with the scene view or game view and easily toggled with a key press. I hear UT is updating the window/docking systems so maybe that might help.

The autocomplete will be very context sensitive, showing you everything you can access from the current scope/literal chain. I have been working on an expression resolver to resolve the expression left of the cursor to the correct type and static or instance state so I can use a combination of reflection and parser info to determine what items should be added to the autocomplete list. So simply typing any character when there is whitespace before it will result in seeing everything currently visible from the current scope and namespaces, and after typing a “.” it will resolve the expression left of the “.” and determine what should be added to the list.

  • gameObject.transform. will show all public members accessible from an instance of Transform.
  • (gameObject.GetComponent()). will show public members in MyCustomScript.
  • 4567. will show public members form an instance of System.Int32.
  • ((UnityEngine.Object)new GameObject(“ObjectName”)). will show all public members from an instance of UnityEngine.Object.

The item sorting and filtering uses a fuzzy search algorithm so you can could type “mecol” to find MeshCollider.

The text is drawn with a GUI.Label for each line “element”. Elements are things that are separated by formatting.

The editor itself loads instantly. The time it takes to load a script depends on how large with script is. There is also some time dedicated to writing some asset files when loading, to ensure persistent data when going in and out of play mode, which seem to take about half a second. Then for a 3000 line file it takes about 1 more second on top of that. Its splitting the new line characters and building the lines and doing all the formatting for the entire document when loading. I could have the line formatting in a separate thread, but the bulk of the time is in the new line splitting it seems, which has to be done instantly. Its possible that this could be faster though. For loading your average script it should be ready to edit in less than 1 second after clicking it.

Editing after a file is loaded should stay very fast because all intensive tasks such as autocomplete are done in a separate thread. On a slow computer you may have some slowness when scrolling if the window is really big, just because of how much text its rendering. I think there is some new text rendering stuff coming in future releases of unity that could make this faster. My graphics card is about 3 years old and I have no problem scrolling in full screen at 1920x1080.

Screen space usage is a big priority for me. That is why I plan to have the side navigation bar be auto-collapsible so the editor window is almost completely filled by the text editor.

always 1 step ahead aren’t you kurt :stuck_out_tongue: I was planning on making exactly this, but now… I think I’ll just wait for yours
:slight_smile:

What would really put this as a ground breaking solution in my eyes is if the autocomplete would be aware of all your classes written in all different languages. So c# will be autocomplete aware of stuff that you have that’s written in unityscript for example. As it stands a lot of unities built in standard assets are written in js and I have lots of errors in my c# project because I use visual studio and it doesn’t know about the various image effects and things

kurt, you are about to make so much money.

Will this have support for document outline (Like mono-develop does with #regions’s)?

Way to go man! Can’t wait to get my hands on this!

It should see completion data from all languages, because it uses Reflection as well as parsed data to resolve the completion item list.

If I do implement an outliner it would probably be done as more of an API browser, like the object browser in mono develop and visual studio. It would use reflection, which (AFAIK) doesn’t have any region info so it wouldn’t group stuff by region. It definitely would be possible to have region grouping, but then you would be relying more on parsed data which means you need to have different solutions for each language, and I’m not sure if its worth the extra work. Something like this could be done in the future, or by someone else using the plugin system.

I have almost completed the autocomplete stuff. The last major task is to get generics working. Currently it can resolve complex nested expressions and figure out the data from namespace, types, fields, properties, methods and indexers. If there are multiple overloads for a method or indexer it will resolve the arguments to find the types, and match those to the correct method or indexer in reflection and/or parsed data and get the resulting type. Heres a shot of it resolving an expression with multiple indexer choices.

Hopefully I can use this same API to do code tooltips on mouse hover, and showing method overloads while typing.

I have also been thinking about a debugging solution. Creating a stepping debugger in unity is a very strange task because it would be trying to debug itself. The solution I have in mind wouldn’t be a true stepping debugger, but would show you the the same, or more info you would get from one. The difference is it would show you this data after the current frame has ended and/or stack the data up over multiple frames. You would add variable watches and it would show the data line by line next to the code in a sort of timeline with nodes containing info for the state right after each statement execution.

Generics are now autocompleting correctly so pretty much everything should have correct autocompletion data. I’m sure there will be some small issues with certain syntax which can be fixed as they come up. I still want to add icons that indicate what the item represents (field, method, namespace, etc), and mouse over tooltips that show you info about the item your mouse is over.

Heres some gifs of it in action.

note that the delay in updating while typing is because its currently regenerating all the data every time something is changed. Updating will be nearly immediate when the items are cached.

Its also showing both static and instance members all the time which will be fixed.