Search Unity

Utilities Script Inspector 3

Discussion in 'Tools In Progress' started by Flipbookee, Aug 10, 2013.

  1. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    I'm also getting some errors since installing SI3. upload_2018-3-30_13-25-17.png

    Upon inspection they are being called from:
    upload_2018-3-30_13-26-6.png

    Unity Version 2018.1.0 Beta 12 on Windows 10 64bit.

    Any ideas?

    Cheers buddy,

    Justin
     
    Zbad and Flipbookee like this.
  2. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Hey, thanks @SketchWork! :)

    So far, I got the UI working for the Rename feature and it finds all the references to the symbol being renamed. There's very little work left - I have to replace the text of all references, then verify the results by finding references again. If after renaming I get the same references again it means everything is good and there are no conflicts, otherwise I'll report the conflict and revert the change to avoid breaking your code.

    However, I put that on hold for a couple of urgent fixes I had to do (the one you found is one of them). I hope to get these done by tomorrow and to release a quick patch, then finish the Rename next week.

    Yes, I think I got that fixed already and the fix (with a couple of other small ones) should be released tomorrow evening.
     
    Deeeds, SketchWork and skipadu like this.
  3. ahmidou

    ahmidou

    Joined:
    Sep 17, 2012
    Posts:
    87
    Hi,
    Would it be possible to add compute shaders to the files that can be opened by ScriptInspector? I can't even drag'n drop them in the editor.
    Also I was wondering about the immediate mode, is it still in the pipes? This would be such a great addition!

    Thanks
     
    Flipbookee likes this.
  4. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Yes, I’ll add the compute shaders as well! Someone asked about that some long time ago and I forgot about that...

    And I’ll finish the Immediate Window, but first I have to finish the Rename Refactoring as that’s very close to completing.
     
    ahmidou likes this.
  5. ahmidou

    ahmidou

    Joined:
    Sep 17, 2012
    Posts:
    87
    Awesome, I can't wait for it
     
    Flipbookee likes this.
  6. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    115
    Got this error message:

    [Exception] InvalidCastException: Cannot cast from source type to destination type.
    TypeDefinitionBase.GetThisInstance() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:2307
    SymbolDefinition.ResolveNode() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:10116
    SymbolDefinition.ResolveNode() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:10083
    SymbolDefinition.ResolveNode() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9886
    FGResolver.ResolveNodeInternal() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:13136
    Debug.LogException()
    FGResolver.ResolveNodeInternal() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:13142
    FGResolver.ResolveNode() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:13053
    FGTextEditor.GetTokenStyle() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4111
    FGTextEditor.DoGUI() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:3660
    FGTextEditor.DoGUIWithAutocomplete() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:1853
    FGTextEditor.OnWindowGUI() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:1706
    FGCodeWindow.OnGUI() Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1341
    GUIUtility.ProcessEvent()

    while writing the following code:

    Code (CSharp):
    1.     public static Systems Instance;
    2.     public static string Current { set; get; }
    3.     public static
    4.  
    5.     private class System {
    6.  
    i.e. I started writing the line "public static" and after adding a space the error started to display.
     
    Flipbookee likes this.
  7. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Ah, great... Thanks @tosiabunio! I couldn't repro this like that, but I see the code there is wrong. It's an easy fix, so I'll get this sorted out.
     
  8. ahmidou

    ahmidou

    Joined:
    Sep 17, 2012
    Posts:
    87
    Hey, I was testing the beta 2018 and found out that ScriptInspector is logging this error on compile:

    Code (CSharp):
    1. BadImageFormatException
    2. System.Reflection.Assembly.LoadFrom (System.String assemblyFile) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    3. ScriptInspector.AssemblyDefinition.FromPath (System.String assemblyPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11809)
    4. UnityEngine.Debug:LogException(Exception)
    5. ScriptInspector.AssemblyDefinition:FromPath(String) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11816)
    6. ScriptInspector.AssemblyDefinition:get_referencedAssemblies() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11653)
    7. ScriptInspector.AssemblyDefinition:ResolveInReferencedAssemblies(Leaf, NamespaceDefinition, Int32) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:12305)
    8. ScriptInspector.NamespaceDefinition:ResolveMember(Leaf, Scope, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:5882)
    9. ScriptInspector.NamespaceScope:Resolve(Leaf, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:6483)
    10. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9377)
    11. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9771)
    12. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9780)
    13. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9774)
    14. ScriptInspector.FGResolver:ResolveNodeInternal(Node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:13136)
    15. ScriptInspector.FGResolver:ResolveNode(Node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:13053)
    16. ScriptInspector.FGTextEditor:GetTokenStyle(SyntaxToken) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4111)
    17. ScriptInspector.FGTextEditor:DoGUI(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:3660)
    18. ScriptInspector.FGTextEditor:DoGUIWithAutocomplete(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:1853)
    19. ScriptInspector.FGTextEditor:OnInspectorGUI(Boolean, RectOffset, EditorWindow) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:1801)
    20. ScriptInspector.ScriptInspector:DoGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/ScriptInspector.cs:76)
    21. ScriptInspector.ScriptInspector:OnInspectorGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/ScriptInspector.cs:70)
    22. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    23.  
     
    Flipbookee likes this.
  9. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Thanks @ahmidou! I know about this error with the beta and I believe I have fixed it, but I’ll check again. I was supposed to release that fix a couple of weeks ago, but somehow I couldn’t finish everything these last two weekends. I hope it will be ready by the end of this week...
     
    led_bet, mcmorry and ahmidou like this.
  10. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @Flipbookee Hi tried the last build just released on the store and I'm still getting multiple exceptions on 2018.2.0b2:
    Code (csharp):
    1. BadImageFormatException
    2. System.Reflection.Assembly.LoadFrom (System.String assemblyFile) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    3. ScriptInspector.AssemblyDefinition.FromPath (System.String assemblyPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11767)
    4. UnityEngine.Debug:LogException(Exception)
    5. ScriptInspector.AssemblyDefinition:FromPath(String) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11774)
    6. ScriptInspector.AssemblyDefinition:get_referencedAssemblies() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11640)
    7. ScriptInspector.AssemblyDefinition:ResolveInReferencedAssemblies(Leaf, NamespaceDefinition, Int32) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:12171)
    8. ScriptInspector.NamespaceDefinition:ResolveMember(Leaf, Scope, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:5882)
    9. ScriptInspector.NamespaceScope:Resolve(Leaf, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:6480)
    10. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9374)
    11. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9768)
    12. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9777)
    13. ScriptInspector.SymbolDefinition:ResolveNode(BaseNode, Scope, SymbolDefinition, Int32, Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9771)
    14. ScriptInspector.FGResolver:ResolveNodeInternal(Node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:13002)
    15. ScriptInspector.FGResolver:ResolveNode(Node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:12919)
    16. ScriptInspector.FGTextEditor:GetTokenStyle(SyntaxToken) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4070)
    17. ScriptInspector.FGTextEditor:DoGUI(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:3619)
    18. ScriptInspector.FGTextEditor:DoGUIWithAutocomplete(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:1849)
    19. ScriptInspector.FGTextEditor:OnInspectorGUI(Boolean, RectOffset, EditorWindow) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:1797)
    20. ScriptInspector.ScriptInspector:DoGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/ScriptInspector.cs:76)
    21. ScriptInspector.ScriptInspector:OnInspectorGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/ScriptInspector.cs:70)
    22. UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    Also, the themes are not working. Whatever I select I get weird desaturated colors. Especially the dark ones are really bad.
    Please fix it. It's hard to work without SI3 so I end up filling the console of exceptions :)
     
    Flipbookee likes this.
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Yeah, that’s the old version then. Can you just check which version did you download? It may be even older than 3.0.21 because the themes were fixed in that.
     
  12. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    This is weird. I used the asset store from inside Unity. I have just the Import button available and not the Download one because I just downloaded the last few hours ago. Then I deleted the SI3 folder and imported everything. but the file SI Changes reports the version 3.0.19.
    If I try to import again, the popup doesn't show any file to updated, meaning that they corresponds to what I already have.
     
    Flipbookee likes this.
  13. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Okay, I see... something’s wrong with the Asset Store today. Let me try uploading it again, maybe this will help. If not, I can send the update by email.
     
  14. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I was checking in my Library folder and the package file is dated 18 Nov 2017.
    I tried to remove it so that I can download it again, but Unity keeps showing just Import. Let me do more test before resubmitting. Maybe is a cache issue on my side.
     
  15. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Great it's fixed. Deleting the package, restarting Unity, I was able to download the last version that is great as usual!
    Thank you.
     
    Flipbookee likes this.
  16. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Ah great then! :)

    Lucky you, I tried restarting Unity, but that didn't help... So in meantime, I uploaded it again as version 3.0.22f but it is still getting replicated over to all Unity servers. I'll check that when it's ready...
     
    mcmorry likes this.
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    So, I tried that too - restart and delete didn't help. I was still getting the "Import" button only, not "Download"... :(

    Then I switched to the Old Asset Store, found Si3 and - surprise - there's an "Update" button there! :)

    Seems like only the new Asset Store is broken somehow, while the old one still works fine.
     
  18. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Maybe it was because after deleting it I also tried to import it. Of course, it didn't work. But maybe this helped to clear the cache. Still is an Asset Store bug! :) Good to know.
     
    Flipbookee likes this.
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Heya folks!

    I just wanted to let you know (just in case that wasn't obvious) that:

    Script Inspector 3
    version 3.0.22f
    got released on Asset Store

    (a couple of days ago ;))
    Here's what's new in it:
    - Faster building of parse trees, semantic analysis, and many other optimizations
    - Resolving methods based on named arguments - thanks @_Adriaan
    - Improved compatibility with other plugins - thanks @MostHated
    - Added "Close SI Tabs to the Right" command on SI tabs - thanks @JoeStrout
    - Added "Copy as Path" command on SI tabs.
    - Added printing of text assets with Notepad++ on Windows - thanks @wood333
    - Added progress indicator to Find Results windows
    - Updated DejaVu Sans Mono font to latest version and added its Bold variant - thanks @A0101A
    - Tab Switcher window handles mouse-clicks now
    - Fixed issues with .Net 4.6 - thanks @sngdan
    - Fixed "This visualElement is not my child" error - thanks @syscrusher, et al.
    - Fixed a type cast error - thanks @tosiabunio
    - Fixed an exception while finding all references

    The only issue with that, at least for me, was that that I couldn't update to this new version using Asset Store 2.0, for some reason. The new Asset Store was just offering me the "Import" that imports a previous version, the last one I downloaded from there.

    Switching to the Old Asset Store solves the issue! The Old Asset Store works perfectly and it will show the "Update" button instead of "Import", so use that please :)

    And as always, a gentle reminder to everyone who hasn't rated of posted a review for Si3 - this is a perfect opportunity to do that and I'll be thanking you to the sky and back for that favor!

    I also can't wait to hear how is this new version going to work for you! Please report all issues (if you find some) and I'll take care of them immediately. Otherwise, please don't let me wait forever, but if it works better than before say that so I can sleep well :) (that's just a phrase, I never sleep, there's so much work to do for all the next updates).
     
    _Adriaan, ahmidou and AthrunVLokiz like this.
  20. dozhwal

    dozhwal

    Joined:
    Aug 21, 2014
    Posts:
    59
    Thx for continious updates !
    It's so relaxing to code in Unity !

    There is a feature i think it lacks and that could be useful to others.
    In sublimetext 3, you can jump very easily to any methods with Ctrl+R.
    Now, i use Ctrl+F but it show commentaries and variables beginning with the same text. so i lose time.
    I would find useful to have the method list like region dropdown ?
    Anyone would like that also or am i the only one ? ;)

    The Sublimetext Ctrl+R feature :


    Another thing just in case : would it be possible to change syntax scheme to add different background color ?
    In fact, in a imaginary world, i would like to set color background just for particular words. (true would have a green background, false a red,..). i think it would make scripting easier. if you have a hint on "it is possible?" and "where in your code i must work to do that ?", it would be cool ;)
     
    Flipbookee likes this.
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Thanks @dozhwal! It's really great to know that :)

    Please consider giving Si3 a stars rating, or even better, posting a review :) that may help others find out is this something worth purchasing or not. Most importantly, it will help Si3 in its race to the top of the list of editor extensions with the most 5 stars reviews (well, assuming here you may give it a 5 stars rating) as it's in the top 10 assets currently and it needs very few more to get in the top 5 assets by user reviews :cool:

    No, I think everyone will like that, even I am missing that feature sometimes! There's a very close alternative though right now - press Alt+M on Windows or Ctrl+M on OS X and this will drop-down the last breadcrumb button in the code navigation toolbar with all the members of the current context listed in it. Then press the first letter of the method you were looking for and you'll get there really quickly... Still, a fully featured Go to Any Symbol command is in preparation and will be released soon.

    All of the existing Si3 color themes can be tweaked to your liking! They are all inside the Assets/Plugins/Editor/ScriptInspector3/Scripts/Themes folder and the code is pretty straight forward and easy to understand. For example, you'll notice a field called "background" and this one defines the background color, so simply change the Color value assigned to it and save the script, wait for it to get recompiled, and you'll see its effect immediately. :)
     
    Deeeds and dozhwal like this.
  22. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Oh, thank you @dozhwal! That's so kind :)

    Review.png
     
    dozhwal likes this.
  23. KAW0

    KAW0

    Joined:
    Jan 1, 2017
    Posts:
    15
    Flipbookee likes this.
  24. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Hey, thanks @KAW0 :cool:

    Yeah, I see what you mean. I forgot about that... Yes, I will add that!!! Thanks for reminding me :)
     
    KAW0 likes this.
  25. KAW0

    KAW0

    Joined:
    Jan 1, 2017
    Posts:
    15
    Last edited: May 22, 2018
    Flipbookee likes this.
  26. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    EDIT: Oh this asset has two forum threads. Neat.
     
    Flipbookee likes this.
  27. KAW0

    KAW0

    Joined:
    Jan 1, 2017
    Posts:
    15
    Code (CSharp):
    1. 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]'.
    2. System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer (System.Object comparer) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    3. System.Collections.Generic.ArraySortHelper`1[T].Sort (T[] keys, System.Int32 index, System.Int32 length, System.Comparison`1[T] comparer) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    4. System.Collections.Generic.List`1[T].Sort (System.Comparison`1[T] comparison) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    5. ScriptInspector.FGFindInFiles.FindReferenceCandidates (ScriptInspector.SymbolDefinition symbol, System.String localAssetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:469)
    6. ScriptInspector.FGFindInFiles.FindAllReferences (ScriptInspector.SymbolDefinition symbol, System.String localAssetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:101)
    7. ScriptInspector.FGTextEditor+<DoGUI>c__AnonStorey5.<>m__0 () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2799)
    8. UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121)
    Bug when I try use "find all references" on MonoBleedingEdge. Work properly on old Mono.
     
    Last edited: Jul 7, 2018
    Flipbookee likes this.
  28. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    Got that error, too.
     
    Flipbookee likes this.
  29. KAW0

    KAW0

    Joined:
    Jan 1, 2017
    Posts:
    15
    Last edited: Jun 4, 2018
    Flipbookee and skipadu like this.
  30. skipadu

    skipadu

    Joined:
    Jan 19, 2016
    Posts:
    3
    Tried to take Script Inspector 3 into use with Unity 2018.1.1f1 but cannot get it working:

    Code (CSharp):
    1. Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs(826,79): error CS0433: The imported type `System.Runtime.CompilerServices.ExtensionAttribute' is defined multiple times
    2.  
    (I have used SI3 with a previous version without a problem)
     
    Flipbookee likes this.
  31. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Wow, guys! Somehow I missed all these messages recently... My apologies about that!

    @skipadu That's a really strange error. I think I've tried Si3 in Unity 2018.1.1 and it all worked fine, but I'll check again to be sure... Just tell me please, what version of Si3 was that?
     
  32. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Hmm, interesting... How do I switch to MonoBleedingEdge? That should be an easy fix if I know how to repro the error.
     
  33. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    YAY! That's amazing! :) I can't wait to try these icons :)

    One thing though, it would be much nicer if they were packed in a .unitypackage for easy importing. It would be even nicer if they were built-in inside Si3 and we could switch to them from the Si3 Preferences :cool: (I'll take care of that)
     
  34. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Hehe yeah. The other one is the main thread, while this one started with the beta of Si3 and for longer time it was only dedicated to beta users, but then after the release some people stayed on this thread, so the difference between the two threads is unknown now ;) even for me :)
     
  35. KAW0

    KAW0

    Joined:
    Jan 1, 2017
    Posts:
    15
    Mono= .NET 3.5 Equivalent
    MonoBleedingEdge= .NET 4.x Equivalent
    I tested it again. It only happens with biuldin members.
     
    Last edited: Jun 4, 2018
    Flipbookee likes this.
  36. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Okay, that’s a great hint. Thanks!
     
  37. KAW0

    KAW0

    Joined:
    Jan 1, 2017
    Posts:
    15
  38. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Right... That's because C# 6 is not supported in Si3 yet, but that part of the syntax in particular is fairly easy to add. I'll take care of that!
     
  39. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Bad news, man
    Unity 5.6.5f1, lastest version of SI3, the problem persist after I renaming some asset files. Forcing scripts to recompile seems to fix it

    Code (CSharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. FGTextBuffer.FormatLine (Int32 currentLine) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2647)
    3. FGTextBuffer.ReformatLines (Int32 fromLine, Int32 toLineInclusive) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2633)
    4. FGTextBuffer.ProgressiveLoadOnUpdate () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:712)
    5. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)
    6.  
     
    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Thanks @thienhaflash for reporting that and for the repro steps! That should definitely help chasing the issue...
     
    thienhaflash likes this.
  41. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Another one, man

    Code (CSharp):
    1. ArgumentOutOfRangeException: startIndex + length > this.length
    2. Parameter name: length
    3. System.String.Substring (Int32 startIndex, Int32 length) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:356)
    4. ScriptInspector.FindResultsWindow.OnGUI () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FindResultsWindow.cs:1288)
    5. 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)
    6.  
     
    Flipbookee likes this.
  42. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Ah, interesting, I never saw that. Great find, thanks man... (I'm wondering, what would I do without you? ;))
     
    thienhaflash likes this.
  43. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Yet another one, I have no idea why this happens. Anyway, you can ignore it as it' s not persistent, just clear the console then good

    Code (CSharp):
    1. ArgumentException: Arg_InsufficientSpace
    2. Parameter name: chars
    3. 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) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:797)
    4. 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) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:744)
    5. System.Text.UTF8Encoding+UTF8Decoder.GetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:1114)
    6. System.IO.StreamReader.ReadBuffer () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:358)
    7. System.IO.StreamReader.ReadLine () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:484)
    8. System.IO.File.ReadAllLines (System.IO.StreamReader reader) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:576)
    9. System.IO.File.ReadAllLines (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:561)
    10. ScriptInspector.FGFindInFiles.GetOrReadAllLinesForPath (System.String assetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:576)
    11. ScriptInspector.FGFindInFiles.GetOrReadAllLines (System.String assetGuid) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:564)
    12. ScriptInspector.FGFindInFiles.FindAllInSingleFile (System.Action`4 addResultAction, System.String assetGuid, ScriptInspector.SearchOptions search) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGFindInFiles.cs:501)
    13. ScriptInspector.FindResultsWindow.Update () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FindResultsWindow.cs:430)
    14. 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)
    15. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    16. 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)
    17. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    18. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:262)
    19. UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)
    20. UnityEditor.HostView.SendUpdate () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:330)
    21. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)
    22.  
     
    Flipbookee likes this.
  44. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    That’s really a weird one and it looks like it’s a bug in Unity’s implementation of .Net libraries with Mono. Searching Google shows that exception gets thrown occasionally by the compiler as well in Unity...
     
  45. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    I have had SI3 for years and it's only today that I discovered the wonderful CodeSnippets facility. Pretty funny. I am only getting back to Unity after a long break so maybe I am not familiar with all the latest changes, but it looks like snippets were added a looooong time ago and I was just oblivious.

    I did make a couple quick changes to the snippets (to adjust { on same/next line to match my preference) and noticed that on OSX I was not able to "save all modified files" using Cmd+Alt+R. I didn't open each snippet to a new tab, and made the changes just using the default inspector embedded editor. The "Assets" menu on the menu bar flashes but the only item I think it might be hitting is "Assets > Refresh ⌘R". Is this a known issue or am I barking up the wrong tree somewhere?

    Second suggestion here is maybe a _readme in this folder which summarizes the usage, including keywords you can use for code snippets. I had trouble locating documentation on them, except for an ancient forum entry you wrote.
     
    Flipbookee likes this.
  46. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Hey @halley, great to see you back! :)

    Yeah, code snippets were added a very long time ago. I even have the feeling they are a bit old now and need some love as well - maybe adding some more Unity specific snippets, some more context aware functionality, etc...

    It will be great if people here share their custom code snippets and I'd love to include the useful ones in future releases!

    Yes, someone reported that already and I didn't investigate that issue too deep because I suggested using the "double` save" feature instead of Alt-Cmd-R, which is to simply press the save shortcut twice. I also explained that there is no need to save files explicitly in Si3 - one can instead just run the game inside the Editor and Si3 will automatically save all changes and Unity will compile the code before entering the game mode.

    Now I also checked the issue and it turns out that the main menu items using Cmd-modified shortcuts can also be executed by the same shortcut combined with Alt! :eek: So the Cmd-R shortcut on Assets->Refresh also handles the Alt-Cmd-R shortcut of Si3... which is terrible...

    There's an easy solution to that issue - adding this line:
    Code (csharp):
    1.     [MenuItem("Window/Script Inspector 3/Save All and Reload Assemblies _&%r", false, 510)]
    just before the MenuReloadAssemblies() method in FGTextEditor.cs adds the command to the main menu and allows Si3 to handle it.

    I'll add that with the next update, but if you're feeling impatient you can add it easily using Alt-Cmd-O to quickly search for FGTextEditor.cs and open it, then Ctrl-M to quickly find the MenuReloadAssemblies() using the Code Navigation bar.

    Right... I may also have to check that post because I don't remember from top of my head :p
     
    halley likes this.
  47. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi, this code editor is simply an awesome work! I don't have to log in Visual Studio and wait for the long opening time and I don't have to use MonoDevelop, which crashes, if I leave my pc for a longer time. Just open Unity and work in Unity without additional overkill code editors. Since a year/half year I barely use other editors, I work in 99.9f percent with your asset inside Unity ;)
    However, I have a small issue. I read the readme, but I cannot find any switch/case refactoring functionality. Expanding enum based 'switch'es would be an important feature.

    Like:

    swich (myType) { -> Expand Switch =
    case Type1:
    break;
    ...
    case Type100:
    break;
    default:
    break;
    }

    Maybe I just didn't found this feature. Workaround is simple, use MonoDevelop for this feature.
     
    Last edited: Jun 30, 2018
    Fattie and Flipbookee like this.
  48. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    YAY! That's great to hear! Thanks @mkgame, you made my day :D

    Say, is Si3 maybe good enough for a nice review? That would make my whole week as well...

    Right! I know, that's a missing feature and it's easy to add, just I promised to myself I won't work on other features before I finish the Rename Refactoring, which is now very close to completion. Once that's done, I can easy add this a well.
     
    Lars-Steenhoff and mkgame like this.
  49. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hi @Flipbookee, I've just added Si3 to a big commercial project in 2018.2, and I'm getting a lot of this error in the console:

    ArgumentException: Invalid path
    System.IO.Path.GetDirectoryName (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Path.cs:215)
    ScriptInspector.AssemblyDefinition.FindScriptAssembly (System.Reflection.Assembly assembly) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:12005)
    ScriptInspector.AssemblyDefinition.IsScriptAssembly (System.Reflection.Assembly assembly) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11997)
    ScriptInspector.FGParser..cctor () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGParser.cs:386)
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for ScriptInspector.FGParser
    System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101)
    UnityEditor.EditorAssemblies.ProcessEditorInitializeOnLoad (System.Type type) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:93)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    That's right here:
    Code (csharp):
    1. #if UNITY_2017_3_OR_NEWER
    2.    public static UnityEditor.Compilation.Assembly FindScriptAssembly(Assembly assembly)
    3.    {
    4.        var location = System.IO.Path.GetDirectoryName(assembly.Location);
    5.  
    So, apparently assembly.Location is invalid? I threw a Debug.Log of that in right before the troublesome line, and it shows that assembly.Location is either null or empty in this case.

    Any idea how to fix this?

    EDIT: adding this as the first line of the method seems to do the trick, but what do you think?
    Code (csharp):
    1.        if (string.IsNullOrEmpty(assembly.Location)) return null;

    Thanks,
    - Joe
     
    Flipbookee likes this.
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,798
    Hey @JoeStrout, thanks for reporting this issue and for debugging it and even fixing it! :)

    Checking the MSDN documentation for Assembly.Location shows an empty string is a valid value for an assembly created by Assembly.Load(Byte[]) method, but I wasn't aware of that...

    Your fix sounds perfect to me, so thanks, I'll add it on my end as well for the next release.
     
    JoeStrout likes this.