Script Inspector 3 - World's Fastest IDE for Unity

@h00w Yes, you can type Chinese characters, but currently they’ll render incorrectly in the view because Si3 assumes the width of all characters is equal, while Asian characters are wider and they may overlap with some other text in the line. I can fix that, just it isn’t a trivial fix and that’s why it hasn’t been fixed yet. But I know this is an issue for all my Asian friends, so I’ll focus on getting this fixed sooner!

Some bad news, man, not really sure if reported or not. I have no idea but maybe some try-catch help?

I have some binary assets (ending with .bytes). SI3 might have assumed that those files are UTF8-Encoded so lead to reading errors?

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)
Could not read the content of 'Assets/_Art/Resources/ab/4afd1de53a4388053c514c5d14834ae2.bytes' because of the following error:
UnityEngine.Debug:LogError(Object)
FGTextBuffer:ProgressiveLoadOnUpdate() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:689)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
System.ArgumentException: Arg_InsufficientSpace
Parameter name: chars
  at System.Text.UTF8Encoding.InternalGetChars (System.Byte* bytes, Int32 byteCount, System.Char* chars, Int32 charCount, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) [0x00093] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:797
  at System.Text.UTF8Encoding.InternalGetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) [0x0010b] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:744
  at System.Text.UTF8Encoding+UTF8Decoder.GetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) [0x00004] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:1114
  at System.IO.StreamReader.ReadBuffer () [0x000bf] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:358
  at System.IO.StreamReader.ReadLine () [0x000e5] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:484
  at FGTextBuffer.Parse (Int32 parseToLine) [0x0014f] in /Volumes/Data/Kame/BC3D/Client-bcid-android/Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:1972
  at FGTextBuffer.ProgressiveLoadOnUpdate () [0x0004c] in /Volumes/Data/Kame/BC3D/Client-bcid-android/Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:685
UnityEngine.Debug:LogError(Object)
FGTextBuffer:ProgressiveLoadOnUpdate() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:690)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
2 Likes

Right, I see… I’ll check what’s going on. Sounds like Unity has imported those binary assets as TextAsset and then that bug in the Mono libraries kicks in.

This is great help, thanks @thienhaflash !

Hi… I’ve been using SI3 for a long time now, and It is great… I have two questions.

1.- Could it be possible to add the functionality so when I press the “Insert” Key on my keyboard, I can Write over previous text? instead of adding text.

2.- I would like to have a custom color Scheme with special behaviour for coloring some things… could it be possible for me to modify something so I can have custom behaviours? for example, I would like the “false” in Red and “true” in green or something like that, instead of the default bool color (can you give me some advice on what scripts to change).

1 Like

YAY!!! Thanks :sunglasses:

Please consider giving it your stars rating, or if you’re feeling extra kind today, maybe even post a review :wink:

Yes, I can add that. The reason it hasn’t been added so far is because I haven’t found that function useful for anything (in the last 35 years!!!) other than to annoy me when I press it accidentally :stuck_out_tongue: but yeah, it’s easy to add that if you think it may be useful for something.

That should be fairly easy to add - I’ll check and I’ll let you know…

1 Like

Hey people, I just wanted to inform you quickly about the recent progress with the Rename Refactoring feature and upgrading Si3 to version 3.1:

The initial implementation started working some time already, but it wasn’t perfect because it was renaming all the references to the symbol being renamed “blindly”, i.e. without verifying the results of that change. That could potentially lead to compile errors if the newly assigned name to a symbol clashes with another name in the scope of the reference to the renamed symbol, so that’s why a true rename would also verify that no such issues get introduced accidentally while renaming.

So I started working on that part as well, but that verification proved to be a bit more complicated than I thought, so it took a bit longer than I expected, but it’s done now and seems like it’s working as expected. It will need a bit more testing before it gets released for everyone and I may need some of you to help me with that. It will e great if I can count on a couple of volunteers for that part, so please let me know if you’re interested in participating :slight_smile:

Thanks!

Since I was one of those asking for this feature, count me in as a beta tester if needed. I have just completed a fairly small project that I could easily and safely clone into a test bed, so even if at worst case SI3 beta totally “ate” my project, no harm done. :slight_smile:

1 Like

Came here after seeing 2018 is dropping support for Mono. Noticed people were complaining about Visual Studio and Community being unreliable and bloatware and also that Rider is too pricey and is now subscription based.

One of the comments praised your plugin and apparently so is the rest of the world ahaha.
I might be in the neighborhood soon for a new IDE so I have some questions to ask:

  1. Will plugin go on sale anytime from now to the next couple months?
    2.Since plugin is part of the project will it also be assembled into the final build causing unnecessary bloat?
    3.Is there any important details I should know before planning a purchase?
1 Like

You will need VS for debugging anyway.

1 Like

Are you saying Script Inspector has no debugging at all?
Does it at least support the debug.log feature that mono had?

1 Like

ScriptInspector absolutely does support Debug.Log() and related functions – they work in SI3 just as they do otherwise. It also works very well with Squiggle, which is a third-party asset that I use which basically puts a chart recorder into an alternate console window, to graph the values of floating point or integer types over time. It’s really handy, and I highly recommend it.

What SI3 does not provide is breakpoints and statement-level single step execution.

Personally, I rarely even use VS for those functions, because I find Squiggle can give me a different viewpoint on essentially the same information – what are my variables doing over multiple frames and over time? Personal preference – I have nothing against VS, but I just find I don’t need it very often.

3 Likes
  • No one but @Flipbookee and the Asset Store team can answer that, so no comment. :slight_smile:
  • No, it will not be part of your final project. It’s in the special folders that Unity automatically excludes from builds, so this exclusion is completely automatic. It “just works”.
  • If you do buy SI3 – and I’m one of those who absolutely recommends it – take the time to look at the editor preferences for SI3 once you’ve installed it. There are a lot of things you can customize to your preference. Also, you will find that if you have SI3 windows open in one project, then you open another project where SI3 is not installed, you’ll get a harmless warning in the Unity editor at startup. This can be safely ignored and only happens as you first start Unity for the project without SI3. Honestly, you’ll probably find you put SI3 into every project, so this will rapidly become a non-issue, but if you see the message don’t panic. :slight_smile:

Hope this helps!

2 Likes

Hey,

I touched based with you a while ago about using this in a custom editor. Any progress? If you dropped the feature we discussed, do you have any ideas on how to make the following more readable? Is there any way to change the color/bold/italic of individual words in EditorGUILayout.TextArea?

Our editors are working great, but I wish the code was a bit more readable (let alone code completion, etc).

1 Like

Hey @DGordon , no I didn’t drop the idea. I’ll still need the embedding to be able to add the Immediate Window as I was planning…

Yes, you can format the text in a TextArea. This explains how to do that: https://docs.unity3d.com/Manual/StyledText.html

I use a different method in Si3, so I can’t tell you how good or bad is that… However, the issue is not trivial. Adding style to individual words is easy, finding out what style to apply to each word is a bit more difficult, unless you want to do that in a simplified way where the styled words are predefined. Even then, you’d have to identify the beginning and the end of a string and skip the styling for words appearing inside the string. It’s a bit tricky, but doable.

And as you said, you’d also want autocomplete and all the other goodies from Si3, so yeah, better to use Si3 for all that. Unfortunately, I can’t say how long it may take me to allow embedding. I must finish Rename Refactoring first, then I’ll consider next tasks from that perspective, based on demand for other features and complexity of each one.

2 Likes

Hey @SilverStorm , thanks for asking and I hope @tosiabunio and @syscrusher already answered most of the questions (thanks guys!), but here’s my view on things as well, for completeness:

No. It is already on a 20% discount for Unity Plus and Pro subscribers, along with many other assets, so you may consider that option if you’re planning to spend enough money on assets. You may end up getting the subscription for free that way and we, the publishers, paying for it.

Other than that, it may go on sale, but I don’t know when. It’s up to Unity Asset Store to organize that and than to include Si3 in it. There’s nothing like that on the horizon that I know… (well, I wouldn’t be allowed to tell that even if I knew because that would lead to banning my assets from that sale and possibly all other future sales, right? ;))

I also don’t plan to reduce the price any further in near future. It used to be $55 and I reduced it $39 just to make it more accessible to people on budget. Si3 is constantly getting new features and improvements, so I should be actually increasing the price, but I don’t. And you’ll get all future updates for free, so I think the current price is quite fair.

No, absolutely not! Nothing from Si3 will get included in a build, not even the tiniest icon images. As @syscrusher said, Si3 gets imported in a special folder of the project, so it all gets ignored when creating a build.

As @tosiabunio already noted, Si3 doesn’t allow debugging by setting a breakpoint and then stepping through code line by line. You’d still need an external IDE for that, either VS Community, VS Code, or Rider. You can, of course, still use Debug.Log to track execution of methods and inspect values that way, and Si3 will make that much easier than any other external IDE - Si3 comes with an improved Console window that allows easy navigation to call-stack of log entries. Additionally, Si3 allows (to some extents) inspecting of static and even non-static fields and properties by putting the mouse pointer over them in your code. If all that is not enough and you need a real debugger with breakpoints, then Si3 will help with that as much as it can - once you’re at the line you want to add a breakpoint, simply press Ctrl-Enter and Si3 will open that script at that line in the external IDE.

I hope this helps and I’m looking forward to see you again here with your first impressions soon :slight_smile:

2 Likes

Thanks so much.

I managed to get this much better using rich text. I didn’t realize that was supported in EditorGUILayout.TextArea. Unfortunately, even though it renders properly with the rich text, it still acts as if there are more characters in the textarea when editing, so its unuseable while editing. However, I’m toggling between a button skinned in the same exact way as the textarea with the color formatting I wanted, and upon click, it switches to the editable textarea without color formatting. Its not as good as what I hope your solution will be, but its much better than what I had before!

1 Like

Ah, I didn’t know editing in rich text mode wouldn’t work. Great trick with the button to switch view modes :slight_smile:

Si3 uses a completely different approach. I re-implemented the whole TextArea, first because I wanted to make the keyboard and mouse handling feel same as in Visual Studio, second because the size of text in a TextArea is limited, third because I wanted to completely alter the rendering with blinking cursor, syntax highlighting, custom word wrapping, search results highlighting, reference highlighting, and especially get maximum speed in styled text rendering so that even smooth scrolling will actually feel smooth.

And that’s only the beginning! In addition, Si3 does syntax analysis by parsing the C# code and creating parse trees, then does semantic analysis of that C# code, which is then used for all the fancy things beyond just regular text editing. It allows unlimited Undo and Redo, code navigation, automatic code generation, and of course the most important for your case - automatic completion…

I’m looking forward to getting the embedding work finally, just I have to finish this Rename Refactoring first and release it. I can’t do anything else until that happens.

2 Likes

bad news again, man

IndexOutOfRangeException: Array index is out of range.
System.IO.StreamReader.FindNextEOL () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:435)
System.IO.StreamReader.ReadLine () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:494)
System.IO.File.ReadAllLines (System.IO.StreamReader reader) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:576)
System.IO.File.ReadAllLines (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:561)
ScriptInspector.FGFindInFiles.GetOrReadAllLinesForPath (System.String assetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:576)
ScriptInspector.FGFindInFiles.GetOrReadAllLines (System.String assetGuid) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:564)
ScriptInspector.FGFindInFiles.FindAllInSingleFile (System.Action`4 addResultAction, System.String assetGuid, ScriptInspector.SearchOptions search) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:501)
ScriptInspector.FindResultsWindow.Update () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FindResultsWindow.cs:430)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:262)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)
UnityEditor.HostView.SendUpdate () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:330)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)
1 Like

Very unfortunately Script Inspector 3 is crashing every time in Mac currently.
Latest Unity, latest OSX, latest SI3.
Any time you make a change, then save, Unity crashes.

LATER …

(1) the SI3 team made massive efforts to fix this problem as soon as it was reported

(2) fortunately it only seems to be a problem in certain builds of Unity Editor

two good things,

(A) the problem seems to have gone away in the most recent Unity Editor release

(B) anyway, SI3 team found a work around for the problem!! :slight_smile:

1 Like

Just out of curiosity, how did you re-implement the whole TextArea? Almost everything I do here these days is editor stuff (game engine is basically fully built … just about making our editors better and better since it will probably be used for quite a number of years) and that sounds like knowledge which would potentially REALLY open doors for what I can do here … in no way planning on competing with your product (not that I could ;)). Was that some tremendously insane hack, or are there built in APIs in Unity which let you do that?

How much effort was it to just recreate a basic textarea, without any extra frills? I’m just testing for pre-defined keywords and coloring those with tags … if I could get something working while its being edited someday, I would love to know which direction to investigate. Super simple functionality for us, but it just makes such a huge difference.

Heck, if you built a separate product and sold it, a textarea that works the same way as EditorGUILayout.TextArea(), but just allowed you to pass in keyword/color (and a color for strings ;)), I would buy it ;). I’m assuming you have enough on your plate though, and that it might not be profitable enough for you, so I’m probably going to have to try that myself if I ever want it :p.

1 Like