Script Inspector 3 - World's Fastest IDE for Unity

Muahaha. I managed to get it working myself when editing. I’m using EditorGUI.LabelField() to draw an exact replica of the textarea over it, skinning the labelfield so it has colored text formatting and a clear background, and the textarea to have invisible text. That way you only see the label’s colored text, but you still get the cursor graphics from the textarea, and you have no funky richtext characters in the textarea to throw off the editing. Its working perfectly!

Thanks so much for putting me on the right path here. :smile:

1 Like

GIF it, or it didn’t happen! :wink:

Thanks @thienhaflash , you’re the best! It’s seems like this is also related to those .bytes files in your project, so I’ll take care of this too…

@Fattie , I’m very sorry about this! Thanks a lot for sending me over email a video of the crash, the crash log, and a test project. Since then I’m trying to reproduce the crash, but I only got it twice with a similar crash log as yours, which is not very helpful, unfortunately. I have no idea why it happens so often on your Mac, mine just doesn’t want to crash, so I wasn’t able to find a pattern that reproduces the crash. Those two cases are just not enough to find out what’s triggering it. I just upgraded my OS X to match your system and quickly tried to reproduce the crash - no luck so far, but I’ll keep trying… I hope something will come out of that very soon…

Well, it was a huge effort, simply said. The whole Si2 cycle was about that mostly, and that lasted for a bit more than a year. I’m used to draw the text with GUI.Label but I switched later to the faster GUIStyle.Draw method. Position of each word is computed, then drawn using an already prepared GUIStyle. The blinking cursor, text selection, current line highlighting, line numbers, highlighted background on search results and symbol references, matching brackets, etc. are all drawn in a similar way.

Drawing was the easiest part though. Handling keyboard and mouse input took even more time, but it was well worth it - this gives rich UX with everything and a bit more of what users would expect from a modern code editor, and people love it! :slight_smile:

Undo and Redo isolated per text buffer was another beast of a task. I’m so proud of how that works now! :slight_smile:

So all that was needed only for the basic text editor. Then the Si3 cycle started - autocomplete with all the related rings and bells took a few more years! And there’s still more stuff to go in that…

I found decompiled Editor source code was the best resource to learn from. Now that’s even easier - all that’s officially supported by the Unity team. They released the source code on github: https://github.com/Unity-Technologies/UnityCsReference/tree/master/Editor/Mono

EDIT: Well, the version 1.0.0 was only a viewer and it had syntax highlighting since the initial release. That took me about 10 days only to create it from scratch, so drawing the text wasn’t a difficult task at all. Cursor navigation with selections via mouse and keyboard took several months and it lasted till the end of Si1 cycle. That was still a viewer only - editing came with Si2.

1 Like

Thanks for all the information. I really appreciate it :).

1 Like

@Fattie I have some good news to share with you - Unity fixed the crash in version 2018.1.7 released just 2 days ago! Versions 2018.1.5 and 2018.1.6 contain the bug and it won’t be fixed because it seems like Unity stopped releasing patches for Unity 2018, but you can avoid using these version…

Thanks to all the details about the crash you shared with me over email, I also managed to find a workaround for using Si3 in Unity 2018.1.5 and 2018.1.6! :slight_smile: I’ll release the workaround today to avoid receiving negative reviews. Just got one by @superFAST2022 :frowning: but that’s the life - each time Unity introduces a severe bug like this, Si3 receives negative reviews even though that’s not my fault at all. That’s why it’s very important to post a positive review if Si3 is making you enjoy working in Unity as never before! Thanks so much to all of you who already did that, and if you haven’t done that yet, it’s the best time for that now! Here’s the link where you can do that: https://www.assetstore.unity3d.com/en/?stay#!/content/3535 and thanks in advance :sunglasses:

Please watch this thread. I’ll announce here when the hotfix is available on Asset Store and it will include all the other minor fixes that were done during the last month.

3 Likes

Appreciate the insights and support!

I use use this tool every day, can’t imagine anymore how people work with external
editors, so much faster using internal.

3 Likes

Has anyone had this suggestion ?!

the actual “close tab” button could be:

Is it possible ?!

That would be huge!

1 Like

You can also use the middle mouse click to close Unity tabs, same as in your browser.

1 Like

Any plans for folding regions support?

3 Likes

Yes, right after releasing the Rename refactoring. I was working on that for a while and I got it half working at that time, now I’d only have to finish that.

1 Like

In OSX - Xcode,

To fold whatever you’re currently inside

the key stroke is

Option-Command-LeftArrow

it gets really built-in to your fingers. I hope this is the keystroke in SI3 :slight_smile:

Folding would be huge, huge.

1 Like

bad news, man, bad news

IndexOutOfRangeException: Array index is out of range.
FGTextBuffer.FormatLine (Int32 currentLine) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2647)
FGTextBuffer.ReformatLines (Int32 fromLine, Int32 toLineInclusive) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2633)
FGTextBuffer.ProgressiveLoadOnUpdate () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:712)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)
1 Like

That’s a strange error, but it should be easy to fix… Thanks @thienhaflash !

Hmm, Alt-Cmd-Left arrow in Si3 moves the cursor back to its previous position… complicated …

Hi, I get this error, when I check for references (right click → FindAllReferences)

2018.2.0f2 (with ECS) on Mac
Net 4.x
IL2CPP

console

ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'System.Comparison`1[System.String]'.
System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer (System.Object comparer) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
System.Collections.Generic.ArraySortHelper`1[T].Sort (T[] keys, System.Int32 index, System.Int32 length, System.Comparison`1[T] comparer) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
System.Collections.Generic.List`1[T].Sort (System.Comparison`1[T] comparison) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
ScriptInspector.FGFindInFiles.FindReferenceCandidates (ScriptInspector.SymbolDefinition symbol, System.String localAssetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:469)
ScriptInspector.FGFindInFiles.FindAllReferences (ScriptInspector.SymbolDefinition symbol, System.String localAssetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:101)
ScriptInspector.FGTextEditor+<>c__DisplayClass204_3.<DoGUI>b__12 () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2799)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121)
1 Like

Wow, that’s an interesting one… Is there a way you could share that project with me?

@Flipbookee

I just figured out that this error happens in an empty project with only SI3 installed - it seems to be related to Net4.x
Net4.x → Error
Net3.5 → No Error

1 Like

I found the issue - it was my fault :face_with_spiral_eyes: and .Net 3.5 wasn’t complaining about that, but .Net 4.6 does. I’ll fix it quickly!