Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Script Inspector 3 - World's Fastest IDE for Unity

Discussion in 'Assets and Asset Store' started by Flipbookee, Jun 2, 2012.

?

What would you like to see in the next update?

Poll closed May 17, 2018.
  1. Line numbers

    140 vote(s)
    36.9%
  2. Code folding

    234 vote(s)
    61.7%
  3. More color schemes

    43 vote(s)
    11.3%
  4. Customizable color schemes

    71 vote(s)
    18.7%
  5. Search functionality

    152 vote(s)
    40.1%
  6. Lower price :D

    104 vote(s)
    27.4%
  7. No thanks, it's fine as it is :)

    11 vote(s)
    2.9%
Multiple votes are allowed.
  1. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @mcmorry, are you or anyone else here using UnityEvents? Because I was working on extending the inspector for them to add a single-click Go To Definition of the member from that list. This will be an amazing way to quickly edit the event handlers! :cool:

    UnityEvents are kind of a new feature in Unity so I wasn't sure is anyone using them already :rolleyes:
     
  2. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Maybe I'm wrong but uGui is using UnityEvents for buttons and other input controls? A way to open directly the code from there or to find in the opened scenes and in prefabs in the project if a method is bound to some UI event would be very useful (find references).
     
    Flipbookee likes this.
  3. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey Flipbookee,

    Thanks for that. Also, the other minor thing I have been asking about is proper indentation for comments. If I paste something, only the comments keep their messed up indentation, and because I am OCD, I go through a wall of text fixing the indentation of just the comments.

    Thanks,
    jrDev
     
    Flipbookee likes this.
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I use them all over the place. I even made a video explaining why.
     
    lermy3d, Tinjaw and Flipbookee like this.
  5. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Well, you know that but Si3 doesn't because it doesn't do code analysis in .js scripts. The point is that it might be referencing the rb in your C# script, so it gets listed just in case. ;)

    That's actually easy, I can easily verify such cases with 100% of certainty! While searching for references Si3 parses and analyses the code that gives a parse tree as output. When I find the string "function" I can walk up the parse tree and check is that string a child of the "argument" node, then walk up again to its parent node "parameter-list" and check is this the only child node there - this will confirm that it's part of a method call that takes one parameter. Then I'd go up again and get to the "method-invocation-expression" node, take the first child node in it and check is that a "StartCoroutine" token. If it is I'd have to resolve that symbol and if that resolves to MonoBehaviour.StartCoroutine method then that's a confirmed reference.

    That may look a little bit too complicated but in fact it's a very trivial thing. Resolving the symbols is the complicated part, but that's already there in Si3, waiting for us to use it in a smart way :cool:
     
    Last edited: Dec 10, 2015
    lermy3d likes this.
  6. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yes, I remember you did. I'll check man! ;)
     
    crafTDev likes this.
  7. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Great and inspiring video tutorial! Thanks for sharing :)

    I don't know about uGui, but in the pre-uGui era I modified the inspector for NGUI events only to be able to jump to the attached event handler directly from there, and that was so amazing! Once the event handlers were all hooked up I didn't have to know and I didn't even care anymore in which script is the handler implemented or what is the name of that method. I would just click the button and see the actual code of the handler method, and check what it does or change something if needed... And that was great! The only thing I was still missing was a button that generates a new method for handling the event, hooks it up, and then opens the code editor inside that method.

    Count on something like that in Si3 soon! ;)
     
    lermy3d and mcmorry like this.
  8. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    With some new Unity apis going around, Im kind of missing the "Resolve" options that MD offers for namespaces. We have mentioned this before, but yesterday noted its missing, giving that Im using the new UnityWebRequest class.
     
    mcmorry and Flipbookee like this.
  9. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yes @Novack, I'm missing that as well now. Using UnityEngine and UnityEditor only is not enough anymore. I'll check if I can add that easily somehow...
     
    punk, mcmorry and Novack like this.
  10. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Thanks mate! I know that we must look like an infinite asking machine, so take it easy and enjoy the awesome-tastic piece of work that Si3 is as well :)
     
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    SarperS, Novack and mcmorry like this.
  12. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    Free advertisement for me! Until you crop me out mercilessly that is :D
     
    Flipbookee likes this.
  13. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    I guess I found a minor bug. In the below line Si3 does not show the parameter list tooltip until I start to type something within the parentheses.

    Code (CSharp):
    1. colliders = GetComponentsInChildren<Collider>();
    Visual Studio does below as soon as the parentheses are opened
     
  14. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Strange... I can't reproduce that. :confused:
     
  15. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    Hmm, I'm on Windows 10 x64 and Unity 5.3
     
  16. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    It's actually much easier to show with a gif. Please see below, it works just fine if I type it for the first time with auto-complete, but if I delete the parenthesis and open them again, it does not show the possible parameters.

     
    Novack and Flipbookee like this.
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    A-ha! I see what you mean now! Awesome find :) and I can repro that, so I'll fix it!
     
    Novack and SarperS like this.
  18. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    SarperS and Novack like this.
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Something like this maybe? :cool:

    XMLDocs.gif
     
    lermy3d, punk, Tinjaw and 3 others like this.
  20. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    Looks great, do you handle all the tags in XML style comments? Like <returns> etc.? Also is there auto-completion of singular tags after the whole thing is generated, like does it auto-complete on adding/removing new tags? Can finally write summaries doxygen can use within Si3!
     
    Flipbookee likes this.
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yes, <returns> and <typeparam> get also added when needed (that example method doesn't return anything). Are there any other tags that should appear initially?

    This only writes the initial template and it will not auto-complete additional tags as you type :p but that's much better than nothing, I hope, and may be sufficient in most cases.
     
    Novack likes this.
  22. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yep! But it looks like the opening "<" is missing from each "param".
     
    Flipbookee likes this.
  23. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Hehe, I see :p I'll fix it!
     
  24. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    Curious - is it possible to make it optionally mark read-only files writable? I use P4 for source control, though sometimes I work offline and have to go and manually flip the files to writable where normally, I'd just like VS / MD mark it writable and reconcile offline work when I get back online. It'd be sweet to have the Read-Only pop-up allow "Mark Writable" as an option - even better would be a checkbox to say "Always mark writable" :) :)

    Oh, and one more "option" while I'm on it - maybe an option to set "zoom in / out" to locked so I can stop accidentally resizing my text with my liberal use of the Ctrl Key.

    Also, loving that comment block stuff! Something I didn't even realize I was missing but would totally use.
     
    Flipbookee likes this.
  25. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    It should be possible, so I'll add the option to remove the read-only flag and also to always do that without asking! :)

    Sure, that's easy ;)

    No more excuses for writing not documented code :p

    Although, "comments are apologies for badly written code" ;)
     
    baby_jeans likes this.
  26. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey Flipbookee,

    I found sometime to look into my tabbing problem and found that this line never becomes true with atleast 2 docked script tabs:
    Code (CSharp):
    1. if (nextTo != null ? panes.Contains(nextTo) : panes.Find(pane =>
    2.                     defaultDockNextTo != null ? pane.GetType().ToString() == defaultDockNextTo : pane is FGCodeWindow))
    3.                 {
    4.                     API.addTabMethod.Invoke(view, new object[] { dockThis });
    5.                     Debug.Log("Here");
    6.                     return true;
    7.                 }
    I put a "Here" log that only becomes true if I already have a tab open. I'm looking more into it but dunno if that helps.

    Thanks,
    jrDev
     
    Flipbookee likes this.
  27. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @jrDev, I see... I'm checking, please stay around for a little bit! :)
     
    crafTDev likes this.
  28. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey Flipbookee,

    Dude, your super fast at response lol.

    Anyways, panes.Contains(nextTo) is false too.

    Also, I will be checking back ever few minutes ok.

    Thanks,
    jrDev
     
    Flipbookee likes this.
  29. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    It's really hard to believe I wrote that piece of code! :oops:

    Please add these lines just before "return false;" at the end of that method:
    Code (csharp):
    1.         if (defaultDockNextTo != null)
    2.         {
    3.             defaultDockNextTo = null;
    4.             return DockNextTo(dockThis, nextTo);
    5.         }
    6.  
     
  30. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey,

    So don't replace anything? Just add that code? Sorry I took long to reply back.

    EDIT: It didn't fix anything in either way I tested. Actually replacing the code I posted prevent docking even when one is already opened. And defaultDockNext is always null.

    Thanks,
    jrDev
     
    Last edited: Dec 17, 2015
  31. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @jrDev, thanks for checking that! Did you say tabs stack up properly on double-click but they don't only when you toggle floating tabs? If that's the case then I have an idea but not a simple one. I'll have to do some changes in a few places and then I'll send you the modified script.
     
  32. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey Flipbookee,

    I got to pop in a say I WISH I COULD GIVE MORE STARS TO SCRIPT INSPECTOR! Your support is AMAZING!

    Thanks,
    jrDev
     
  33. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Hey folks, Unity 4.7.0 was released today and since Si3 didn't compile in it I had to release a quick update... This version doesn't include everything I wanted to add, but at least one of those features is in it. :cool: Feel free to try this out as I'm looking forward to your feedback! :)

    Script Inspector 3, version 3.0.11
    got just released :cool:

    New in version 3.0.11:
    - Updated for compatibility with Unity 4.7.0
    - Auto-expanding /// as XMLDoc comments
    - Fixed resolving of destructors and showing them in breadcrumbs
    - Fixed resolving generic method overloads which was breaking the parameter hints - thanks @Sarper Soher
    - Fixed Results windows after maximizing and restoring a tab - thanks @Sarper Soher
     
    SarperS and Novack like this.
  34. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    412
    Noticed this...Keys displayed wrong
    *Not sure it was an issue with 5.3
    *both SI 3.0.11

    I don't care much, since I don't plan to "use" 5.3.x until 5.3.3+

     
  35. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Yes @bocs, this was an issue in 5.3.0 as well. It was a sad day when I discovered that, but I wasn't sure was that a temporary glitch or a permanent loss. Seems like it's there to stay. I guess, someone at UT has noticed how those special characters used for encoding keyboard shortcut cannot be displayed in the name of menu items, which was result of their own poor design, and now they applied a lazy "fix" by cutting out the feature completely. Previously there were some workarounds for the poorly designed API, now there are no workarounds. :(

    Whoever designs that API is obviously not using it, unfortunately. The only thing you can expect in such situation is that the API will only get worse over time... ;)

    I have no other choice than removing the shortcuts from context menus in Unity 5.3+. Of course, the shortcuts will still work as before since they are not handled by the context menu.
     
    SarperS and Novack like this.
  36. ddt2015

    ddt2015

    Joined:
    Dec 22, 2015
    Posts:
    2
    Unity 4.6.4f1
    Script Inspector 3.0.11

    Hi Flipbookee,

    You implemented Shift+Insert (paste) but not Shift+Delete (cut).

    This is the common behavior in Windows (try MonoDevelop, Notepad, Visual Studio, etc.). Select some text and then Shift+Delete.

    After so many years, my fingers do combos of Shift+End/ Shift+Delete / Shift+Insert all day and I can't stop them. :(

    Can you add this, or give me a quick hack for it? My fingers would thank you.

    Thanks!
     
  37. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @ddt2015, let me check that quickly... Are those more convenient than Ctrl+X and Ctrl+V for you? I have to ask also, just in case, are you maybe doing that because you want to cut and paste a full line?
     
  38. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    In Unity Shift+Delete is the shortcut assigned to Edit->Delete in the main menu, and it's handled by Unity internally. Then a pair of ValidateCommand and ExecuteCommand events are sent to Si3. The "command" sent is "Delete" and it's handled in FGTextEditor.cs in the following code block at line 5698:
    Code (csharp):
    1.             else if (Event.current.commandName == "Delete" && TryEdit())
    2.             {
    3.                 CommandDeleteLine();
    4.  
    5.                 Event.current.Use();
    6.                 return true;
    7.             }
    Now the hack is to change the command to "Cut" and call that same function recursively :) by replacing that block with this one:
    Code (csharp):
    1.             else if (Event.current.commandName == "Delete" && TryEdit())
    2.             {
    3.                 Event.current.commandName = "Cut";
    4.                 return ProcessCodeViewCommands();
    5.             }
     
  39. ddt2015

    ddt2015

    Joined:
    Dec 22, 2015
    Posts:
    2
    Thanks. You rock!
     
    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @ddt2015, I was asking what's your intention because it might be that you wanted to move the line to somewhere else, so I was going to suggest you to try Alt+Up/Down shortcuts. This is a much easier, faster and simpler way for moving a line or multiple lines at the same time up and down. Also the indentation of the lines moved will follow the surrounding code like this:

    MovingLines800.gif
     
    Last edited: Dec 23, 2015
    ddt2015, SarperS and Novack like this.
  41. FatIgor

    FatIgor

    Joined:
    Sep 13, 2015
    Posts:
    29
    I found this quick hack above because like @ddt2015 after years of using it, shift-delete to grab a line, or a selected block, is automatic; knowing other options would require a conscious effort to change. (I grabbed your excellent assett yesterday evening and have spent today testing it out, the shift-delete thing being the one thing I really wanted added to it so far.)
     
    Flipbookee likes this.
  42. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @FatIgor and @ddt2015, then I guess I should consider including this change with the next update ;)

    Unless someone else wants the old behavior. I can also make that optional, but I have a feeling the option will be never used to switch to the old behavior.
     
  43. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    412
    I think I found a bad bug...it crashes unity.

    I wasn't sure why unity would crash while editing some code with SI3..so I tried to figure out a repro case.

    New Project - Import SI3 (3.0.11)
    create a new C# test script
    add this line : public bool Test.xx.xx
    press ; and unity will crash.
    Smart Semicolon will cause unity to crash.
    *no crash if it's disabled

    2+ levels = crash ie
    public bool Test; <-No crash
    public bool Test.xx <-No crash
    public bool Test.xx.xx <-Crash
    etc...

    guess is some kind of recursion error.

     
    Flipbookee likes this.
  44. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Thanks @bocs! Yes, it sounds like infinite recursion, I'll investigate immediately...
     
  45. Gorgor

    Gorgor

    Joined:
    Apr 28, 2012
    Posts:
    51
    Hi,
    I use SI3 and it is awesome! Therefore I am letting you know about small bug I just found.
    When I type:
    "private int xxx.."
    all is ok, but just know I make a mistake and type:
    "private void int xxx.."
    which is nonsense , I was about to declare private int, but I type void into it. However, if I write such declaration SI3 throw error.
    See attached screenshot.
    Just to let you know. And once again, thanks for great tool!
    Martin
     

    Attached Files:

    • bug.png
      bug.png
      File size:
      249.2 KB
      Views:
      932
    Flipbookee likes this.
  46. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @Gorgor, thanks man! Great find :)

    This is fixed now and it will be submitted hopefully by tonight. It's a critical bug fix, so the update will be mandatory ;)
     
    SarperS likes this.
  47. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    Heya my friends! A small present for you ;)

    Script Inspector 3 - version 3.0.12
    is available on Asset Store now :cool:

    What's new? Well, all these:
    - Critical fix! Fixed smart semicolon crash - thanks @bocs
    - After pressing F12 to go to definition, pressing it again returns the cursor back - thanks @Victor_Kallai
    - New Shift+Delete behavior on Windows: "Cuts" the current line to clipboard unless there's nothing selected and "Copy/Cut full line if no selection" is turned off (in which case it will delete the line, same as before) - thanks @ddt2015 and @FatIgor
    - Disabled live inspection of 'mesh' and 'material' properties to avoid unintentional creation of unique instances - thanks @ElSenyor_Eduard
    - Fixed smart semicolon in lines ending with comments - thanks @jrDev
    - Fixed compile warning in FGConsole for Unity 5.4 beta
    - Fixed exception on closing Find Results window
    - Fixed resolving method declarations with syntax errors - thanks @Gorgor
    - Fixed copying full lines and then pasting them in another file - thanks @ElSenyor_Eduard
    - Fixed displaying shortcuts in context menus in Unity 5.3+ on Windows - thanks @bocs
    - Fixed finding (non) references in preprocessor directives - thanks @castor76

    Mostly bug fixes, as you can notice, with only a couple of new features, but make sure to take this update as soon as you can because it includes a critical fix for the bad bug found by @bocs (thanks man)!

    Enjoy! :D
     
    Novack and SarperS like this.
  48. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    The feature you always wanted but you never knew you do ;)

    Press F12 - you're at the definition of a symbol
    F12 again - now you're back where you were before :cool:

    F12.gif

    ...and it works beautifully! :D
     
    Novack and SarperS like this.
  49. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi Flipbookee, while all the things you're adding look amazing, I'm still holding off on using SI3 until the following features are added:
    • Rename
    • Persistent custom themes which don't get overwritten on updates (a UI to select colors would be nice), and possibly could be applied to different projects.
    • Shader syntax highlighting
    Would love to see these in the future!
     
    Flipbookee likes this.
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,788
    @Korindian, I'm working on Rename. It was supposed to be released like now as version 3.1 but there was a small delay in the last two weeks with that. In meantime some bugs were discovered and that's what version 3.0.12 is addressing here. I can't sleep well when I know there are critical bugs... ;)

    Work on Rename resumes now! ;) It shouldn't take too long since Rename is a combination of Find All References and Replace All - features that are both already implemented :)

    Yes, I know that my updates are overwriting your color themes customizations and I'll have to do something about that. I didn't think though that this might be a so big issue that it would hold someone off... Some color themes management functionality is something I always wanted to have in Script Inspector, but with features like Rename still missing it's still really hard for me to find time to do that.

    What customizations do you do in the color themes? If that's something interesting and cool enough maybe I'll want to include that in the official releases? :)

    There is shader syntax highlighting for the ShaderLab part already. Or do you mean for the CG part? That's not there yet. :rolleyes:

    Thanks for your feedback!
     
    Novack likes this.