Search Unity

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. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    Hi,

    it would be great if you could find a way to share your roadmap a little.

    I also think an update poll of what current users are most interest would be good.

    From my end, I would be excited if code folding would come anytime soon. This is something that would increase the productivity on a daily basis. Many other great suggestions are either infrequent or work arounds exist....but this might just be me...
     
    docsavage and Flipbookee like this.
  2. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Sure, I've started make a Trello board once, but I never finished it... :p

    The nice thing about Trello boards is that users can vote on things they prefer to see implemented sooner :)

    Yeah, many people are asking for code folding. I have no choice, I'll have to finish that ;) even though I still can't imagine how hiding code can make anyone more productive. You'll at least have to unhide it at some point, and that's what I see as a really unnecessary operation, which was also preceded by another unnecessary operation - hiding it... In my 17 years of professional programming history I've seen only one experienced programmer doing that, and that's it... Maybe I'll talk to him and ask what's the point of all that. :confused:
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm with you; in my opinion, if you need to fold your code then your method is too long and/or poorly structured.

    But clearly users are clamoring for it, so you should include it... but please also include a preference so we can turn this feature off. :) I don't want a stray click to cause my method or code block to collapse!
     
    Flipbookee likes this.
  4. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    That's why I think the voting would be good - there is no point in developing things for only a handful of people.

    The reason I like code folding is that I like to fold things that I do not concentrate on or that are finished. This way, I can better navigate the code. This is in particular the case for SI3, as I tend to edit the code most of the time in smaller windows and not full screen.
     
    Flipbookee likes this.
  5. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Woot! I asked for that years ago. I recommended uservoice at the time, but whatever option is nice.

    Yup. You're just too stuburn :D

    Code folding is really useful for me when Im working on some particular case that gets me navigating back and forth into distant methods, and I keep scrolling up and down from one series of methods to other, and want to "silence" code in the middle, or not relevant to that precise case. Is much easier for me, visually resting and mentally cleaner.
     
    Flipbookee likes this.
  6. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    I'm all for code folding too :) Absolutely valuable when reading / modifying someone else's code :)
     
    Novack and Flipbookee like this.
  7. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @JoeStrout,

    I'm no coding expert at all (beginner just about managing) but in my game there are cases where it is extremely useful to have codefolding. I used a maze generator to create some random mazes. Altered them and then when happy with then saved the individual vectors out. After some more odd workarounds I end up with a list of node positions and these are used to generate the mazes and content and node properties etc. Each maze has about 400 nodes so about 400 lines. There's 12 levels. So it's handy in this case. Saves a ton of scolling time even if the levels each had a separate method. In most cases it's probably not an issue but after much experimenting this method I used was the best for my game. There are probably better ways but they are probably beyond me anyway at this stage:) If there is a better way please don't tell me. It will only depress me finding out how much easier I could have done it:)

    But having said that if it's a lot of work to implement then I could live without it
     
    JoeStrout and Flipbookee like this.
  8. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hehe yes, I remember that! :) And I promised and started creating the Trello board after that, but I didn't get too far with it :p so I'll try harder this time...

    @docsavage, is the generated maze data you're altering some C# code? Can you post an example here?

    Yes, I see that's a valuable use case. I've been talking to some colleagues recently, and the very few who use code folding said it's a nice alternative of the header file in C++, for example, which makes it much easier to browse other people's code.

    I still can't understand how code folding helps cases described by @Novack and @sngdan, but I guess I'll need to practice that a little bit to see if that helps anyhow. :p

    So yeah, if that's what everyone wants, then yes, code folding gets prioritised now! It will be a fun and challenging enough feature for me to work on.
     
  9. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    I guess for me it is a combination of poorly written code (I have not found a good structure, way of organizing, so it can get out of hand at times) but I also have AI routines, that make heavy use of switch statements (yes, I could put this in separate classes for organization but I like it to be in one place) and then I end up with pages of case x to scroll through, wish it would be just a line.

    Anyways, it's a nice to have feature and let's see if a critical mass of people want it....I have no clue how complicated it is to develop and maintain, but would understand that if it eats up a lot of time, it might just take too much of your time away, so I trust your decision....
     
    Flipbookee likes this.
  10. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    What @sngdan said is absolutely true, I usually work with code that nested deep inside multiple levels (say, 8+ ?) and crossing multiple pages.

    Without code folding, I never know where I am, which condition am I in. Yes, it's bad code but we can not rewrite everything to get rid of it, so need to find a way to live with it :)

    Hope it sounds more convincible to you :)
     
    Flipbookee likes this.
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Yep, it does... Great example :)
     
  12. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
  13. phoenixrising

    phoenixrising

    Joined:
    Aug 9, 2013
    Posts:
    57
    I just started using this and when I do a find by reference it is returning all the vars as well as the correctly matched references. Is there a way to not have it show the vars? It is clogging up the find by reference window. Thanks.
     
    Flipbookee likes this.
  14. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Yes, the toolbar in the References tab has buttons to control the filtering of results:
    Var References.gif

    I can change the default to be off for var references if that would make more sense? :rolleyes:
     
  15. phoenixrising

    phoenixrising

    Joined:
    Aug 9, 2013
    Posts:
    57
    I cant make such a nice video but I have 2 screen shots, I think maybe its only if I try to find a class by reference.
    I cannot seem to be able to hide the var references.
     

    Attached Files:

    Flipbookee likes this.
  16. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Oh, I see. Those var keywords were not resolved, most likely because that script is using "unsafe" code that involves pointers, and Si3 still doesn't know how to resolve such expressions. I should actually fix that (by implementing that feature).

    That's one thing, and there's another one - unresolved var references shouldn't be shown when the var toggle is off! That's a bug indeed and I can fix that easily. ;) I guess I didn't realize you won't want to see those as references, because in case of me, I actually want to see those because that way I can easily spot issues in the resolver :p
     
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Fun fact:
    Did you know that out of 2165 editor extensions currently available on Asset Store, only 12 of them have received more 5 stars reviews than Script Inspector 3? :)

    And only two weeks ago that number was 14, so thanks for all your great reviews! They mean a lot to me :cool: especially when I'm facing with a complicated feature to implement and I need something to boost my motivation...
     
    UnLogick and Novack like this.
  18. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Bad news for today,

    I have no idea what happens, editing some code with SI3 v3.0.16...

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ScriptInspector.FGTextEditor.DoGUI (Boolean enableGUI) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:3529)
    3. ScriptInspector.FGTextEditor.DoGUIWithAutocomplete (Boolean enableGUI) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2883)
    4. ScriptInspector.FGTextEditor.OnWindowGUI (UnityEditor.EditorWindow window, UnityEngine.RectOffset margins) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2739)
    5. ScriptInspector.FGCodeWindow.OnGUI () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1263)
    6. 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)
    7.  
     
    Flipbookee likes this.
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Thanks man! I'll fix that...

    In the other news today, I came across this:
    Microsoft will release Visual Studio for the Mac

    I'm not sure is that going to be a rebranded Xamarin Studio or something else, but who cares when you already have "by far the best code editor for Unity on Mac" - @Eriks-indesign :cool: (thanks man, great review :D)
     
  20. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Bad news, the script references sometimes does not work correctly ...

    In this example, I write a script with a single generic function CreateAsset, SI3 some how misunderstanding it as AssetDatabase.CreateAsset (Note that I did not choose String / Comment matches)

     
    Novack and Flipbookee like this.
  21. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey @thienhaflash, that's intentional to some degree... The word CreateAsset was found in a .js script and since Si3 doesn't do code analysis in UnityScript files, it doesn't know what symbol is referenced, so it stays on the safer side by reporting it as potential reference highlighted in yellow.

    However, there are two other things to be improved here:
    - There should be a filtering button for hiding potential references, similarly as there are buttons for everything else; and
    - Judging by the paths of both scripts, it isn't possible to reference CreateAsset declared in that .cs script from that other .js script, because both scripts will be compiled in two different non-first-pass editor assemblies that don't reference each other. Si3 should be a bit smarter here and understand that rule to reduce the number of potential references like this one.

    And the third improvement would of course be to do full parsing and code analysis on .js scripts, but that's a lot of work, so it may take a while...

    Thanks for reporting this! I don't keep .js scripts in my test projects, so I almost forgot Find References is actually looking for potential references there as well.

    Beautiful screenshot, by the way! ;)
     
    Novack likes this.
  22. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    punk and Flipbookee like this.
  23. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Oh @thienhaflash, that's super-nice feature! :) I love it and it doesn't depend on code folding, so I can add it right now :cool:
     
    punk and docsavage like this.
  24. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    i think he was hinting at "please finish code folding" :) haha, that's just me trying to put it on the prio list...
     
    Novack and Flipbookee like this.
  25. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hehe :) yeah, after all those people asking for it and my failed attempt to convince them it's an unnecessary feature :p yes, it's already at the top of the prio list, only slightly weighted down because of its complexity, but that isn't much really ;)
     
    Novack and docsavage like this.
  26. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    If existed, code folding would have come really handy when working extracting the colour themes from a file with +10k lines of code :p :D:D

    Edit: and by that, I mean THANKS for doing it!
     
    Flipbookee likes this.
  27. Eriks-indesign

    Eriks-indesign

    Joined:
    Aug 15, 2012
    Posts:
    50
    You're welcome! Keep up the amazing work!
     
    Flipbookee likes this.
  28. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Time for another essential feature request (SI3 already have I think) : A Toggle Button to Lock Script Reloading, preferably always visible at the top right corner of current tab :) (No, please don't hide it in the context menu of the tab, it's essential that we can see the locking status visible any time)

    Basically, when creating new script or pressing Ctrl + D to duplicate scripts or moving scripts around, Unity will automatically recompile and reload scripts, it takes much of valuable time to wait for those. It would be absolutely great if we can lock script reloading manually while doing those.

    I already have that Toggle in my Editor script but think It would better if SI3 have it also

    Thanks :)
     
    radimoto, Flipbookee and Novack like this.
  29. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey @thienhaflash, do you know how to do that? I don't, but if there is a way, I'd definitely like to know! :) I thought that's outside of my control because moving scripts happens in the Project view and I think Unity will trigger a recompile without "asking" editor scripts is that okay or not?
     
  30. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    @Flipbookee : I suppose that there would be a better way than what I'm doing right now : Generate a .cs file that is not compilable, put it in plugin folder, this way Unity will not be able to finish its first pass compile and stop. This will resulted in an error showing in the console and that might not look great, but it's ok to me :)

    A little search point me to another solution, might be better if works but I haven't test yet. You call StartAssetEditing() when lock, and call EndAssetEditing() when release. I don't know if this will prevent normal asset import or not :)

    Another stupid idea is that we can open the dll files in Library/ScriptAssemblies folder when lock to prevent changes from unity, not sure if this would work or have any drawback

    Edit : Found this, I haven't tested but looks quite promising :) : move the compiler to somewhere else :D

    https://github.com/appetizermonster...RecompileDisabler/Editor/RecompileDisabler.cs
     
    Last edited: Nov 20, 2016
    Flipbookee likes this.
  31. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey @thienhaflash, removing the compiler is an interesting solution :) but however, not very practical as there are a number of issues connected with that solution. First, that method is not local for the current project only, as removing the compiler would affect all instances of that version of Unity Editor, so compiling in other projects opened simultaneously will get affected, or if the script is used in more than one project then those projects will be conflicting with each other. Second, it will be tricky to restore the Unity Editor if it crashes while the compiler is removed! ;)

    Your solution with a non-compilable .cs script is also interesting, but it may also go wrong if Editor crashes unless you've got a solution for that too?

    That sounds as a better idea - if it works. We should check that! :)

    That might be the best idea so far, of course, if it works and there are no other drawbacks. :)

    My method used in the experimental "compile in background, but don't reload" Si3 option is using LockReloadAssemblies, but it's very far from perfect because Unity ignores that whenever a menu is shown or on switching from Unity to another application and then back to Unity. On OS X this also happens whenever a new window is shown, and with Si3 that happens quite often, so that Si3 option is not available on OS X at all... I'd love to develop that option more and remove the "experimental" word on it if there is a reliable solution :cool:
     
  32. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    It always give you an error in the output log so if the editor crash and you open it again, nothing changes, when you open the window that contains toggle button it will check and see that the temp.cs file is still available and will show the status as locked when you click on that button to unlock the temp.cs will be deleted.

    Right now, the only problem with me is that the error is quite annoying :D
     
    Flipbookee likes this.
  33. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Bad news for today, SI3 v3.0.16

    Code (CSharp):
    1.  
    Another one :) Not sure if it helps but I think it's related to generics <T>. This part of my code cause error
    Code (CSharp):
    1. R3_AssetT<T> LoadResources<T>(string url) where T : Object
    2.     {
    3.         //Debug.Log("Start : " + url);
    4.         return Resources3.Load_Resources<T>(url)
    5.             .Set_OnComplete((data)=>
    6.             {
    7.                 Debug.Log("Loaded :: " + data);
    8.             })
    9.             .Set_; //error here  
    10.     }
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ScriptInspector.MethodGroupDefinition.CollectCandidates (System.Collections.Generic.List`1 argumentTypes, ScriptInspector.SymbolDefinition[] resolvedArguments, ScriptInspector.Modifiers[] modifiers, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:4229)
    3. ScriptInspector.MethodGroupDefinition.ResolveMethodOverloads (System.Collections.Generic.List`1 argumentTypes, ScriptInspector.SymbolDefinition[] resolvedArguments, ScriptInspector.Modifiers[] modifiers, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:4369)
    4. ScriptInspector.MethodGroupDefinition.ResolveMethodOverloads (ScriptInspector.Node argumentListNode, ScriptInspector.SymbolReference[] typeArgs, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:4217)
    5. ScriptInspector.SymbolDefinition.ResolveArgumentsNode (ScriptInspector.Node argumentsNode, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf, ScriptInspector.SymbolDefinition invokedSymbol, ScriptInspector.SymbolDefinition memberOf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:8418)
    6. ScriptInspector.SymbolDefinition.ResolveNode (ScriptInspector.BaseNode baseNode, ScriptInspector.Scope scope, ScriptInspector.SymbolDefinition asMemberOf, Int32 numTypeArguments, Boolean asTypeOnly) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9068)
    7. ScriptInspector.FGResolver.ResolveNode (ScriptInspector.Node node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11716)
    8. UnityEngine.Debug:LogException(Exception)
    9. ScriptInspector.FGResolver:ResolveNode(Node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11722)
    10. ScriptInspector.FGTextEditor:GetTokenStyle(SyntaxToken) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4724)
    11. ScriptInspector.FGTextEditor:DoGUI(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4313)
    12. ScriptInspector.FGTextEditor:DoGUIWithAutocomplete(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2883)
    13. ScriptInspector.FGTextEditor:OnWindowGUI(EditorWindow, RectOffset) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2748)
    14. ScriptInspector.FGCodeWindow:OnGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1263)
    15. UnityEditor.DockArea:OnGUI()
     
    Last edited: Nov 21, 2016
    Flipbookee likes this.
  34. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    @thienhaflash , how do you get those crashes? Is this during normal use or are you stress testing SI3?

    As hard as I try, it never fails me, but I am happy you find them as it makes the release more stable.
     
    Flipbookee likes this.
  35. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    @sngdan : I don't know why it happens neither :D. I'm sure I'm not the only one who use SI3 as the only C# editor! I'm working on my tools and games, just like everyone else :D
     
    Flipbookee likes this.
  36. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    :D Hehe yeah, I don't know how @thienhaflash is doing that either! I often have to dive deep in the code to understand the issue.

    But it's been a tremendous help for me to have all the bugs reported here and I'd probably never discover them without him. :) It's also great to know there's always someone kind like him behind me to catch all my mistakes before anyone else encounters them :D

    @thienhaflash, you've reported the first crash log already and it's been fixed but not released yet. The second one is new and unique. It looks like another great find - thanks for the code example :)

    EDIT: I forgot to mention that this might be due to @thienhaflash' unique programming style. Have you seen his code? He's always pushing the C# language to its limits :cool:
     
    thienhaflash and Novack like this.
  37. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Sorry man :D I really can't remember which is which, just copy and paste whenever I saw it :D

    And bad news for today :D Hopefully it hasn't been reported before :D
    This part of code yields the errors
    Code (CSharp):
    1. Resources3.Load_Web<AssetBundle>(GetBundleId(b.bundleName))
    2.             .Set_OnComplete(b.SetDone)
    3.             .Set_OnError(b.SetError);//Error here, SI3 does not understand Set_OnError
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ScriptInspector.FGResolver.GetMemberCompletions (ScriptInspector.SymbolDefinition targetDef, ScriptInspector.BaseNode parseTreeNode, ScriptInspector.AssemblyDefinition assemblyDefinition, System.Collections.Generic.Dictionary`2 d, Boolean includeExtensionMethods) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11618)
    3. ScriptInspector.FGResolver.GetCompletions (IdentifierCompletionsType completionTypes, ScriptInspector.BaseNode parseTreeNode, System.Collections.Generic.HashSet`1 completionSymbols, System.String assetPath) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11387)
    4. UnityEngine.Debug:LogException(Exception)
    5. ScriptInspector.FGResolver:GetCompletions(IdentifierCompletionsType, BaseNode, HashSet`1, String) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11445)
    6. ScriptInspector.FGTextEditor:Autocomplete(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:6639)
    7. ScriptInspector.FGTextEditor:DoGUIWithAutocomplete(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2873)
    8. ScriptInspector.FGTextEditor:OnWindowGUI(EditorWindow, RectOffset) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2739)
    9. ScriptInspector.FGCodeWindow:OnGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1263)
    10. UnityEditor.DockArea:OnGUI()
    11.  
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ScriptInspector.FGTextEditor.GetSymbolDeclarations () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:7349)
    3. ScriptInspector.FGTextEditor.DoGUI (Boolean enableGUI) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:3453)
    4. ScriptInspector.FGTextEditor.DoGUIWithAutocomplete (Boolean enableGUI) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2883)
    5. ScriptInspector.FGTextEditor.OnWindowGUI (UnityEditor.EditorWindow window, UnityEngine.RectOffset margins) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2739)
    6. ScriptInspector.FGCodeWindow.OnGUI () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1263)
    7. 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)
    8.  
     
    Last edited: Nov 22, 2016
    Flipbookee likes this.
  38. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Yep, no problem, I'll take care of the duplicates ;)

    Thanks man! I'll check these two later today... :)
     
  39. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Another one (I previously think it's because script reload in PlayMode and will go away when recompile where actually it's not). I got it persistently reproducible now ...

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ScriptInspector.MethodGroupDefinition.CollectCandidates (System.Collections.Generic.List`1 argumentTypes, ScriptInspector.SymbolDefinition[] resolvedArguments, ScriptInspector.Modifiers[] modifiers, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:4229)
    3. ScriptInspector.MethodGroupDefinition.ResolveMethodOverloads (System.Collections.Generic.List`1 argumentTypes, ScriptInspector.SymbolDefinition[] resolvedArguments, ScriptInspector.Modifiers[] modifiers, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:4369)
    4. ScriptInspector.MethodGroupDefinition.ResolveMethodOverloads (ScriptInspector.Node argumentListNode, ScriptInspector.SymbolReference[] typeArgs, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:4217)
    5. ScriptInspector.SymbolDefinition.ResolveArgumentsNode (ScriptInspector.Node argumentsNode, ScriptInspector.Scope scope, ScriptInspector.Leaf invokedLeaf, ScriptInspector.SymbolDefinition invokedSymbol, ScriptInspector.SymbolDefinition memberOf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:8418)
    6. ScriptInspector.SymbolDefinition.ResolveNode (ScriptInspector.BaseNode baseNode, ScriptInspector.Scope scope, ScriptInspector.SymbolDefinition asMemberOf, Int32 numTypeArguments, Boolean asTypeOnly) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:9068)
    7. ScriptInspector.FGResolver.ResolveNode (ScriptInspector.Node node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11716)
    8. UnityEngine.Debug:LogException(Exception)
    9. ScriptInspector.FGResolver:ResolveNode(Node) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTypeSystem.cs:11722)
    10. ScriptInspector.FGTextEditor:GetTokenStyle(SyntaxToken) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4724)
    11. ScriptInspector.FGTextEditor:DoGUI(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:4313)
    12. ScriptInspector.FGTextEditor:DoGUIWithAutocomplete(Boolean) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2883)
    13. ScriptInspector.FGTextEditor:OnWindowGUI(EditorWindow, RectOffset) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2748)
    14. ScriptInspector.FGCodeWindow:OnGUI() (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1263)
    15. UnityEditor.DockArea:OnGUI()
    16.  
     
    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Yep, you sent me this one ;) saying this code triggers it:
    Code (csharp):
    1.  
    2. R3_AssetT<T> LoadResources<T>(string url) where T : Object
    3.    {
    4.        //Debug.Log("Start : " + url);
    5.        return Resources3.Load_Resources<T>(url)
    6.             .Set_OnComplete((data)=>
    7.            {
    8.                Debug.Log("Loaded :: " + data);
    9.            })
    10.             .Set_; //error here
    11.    }
    I'll fix it...

    EDIT: In meantime if that spamming is annoying you, feel free to comment out that Debug.LogException ;)
     
  41. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    @Flipbookee: One good thing about SI3 is that if I don't touch that errorneous part SI3 will be able to work fine. I was able to continue to work within SI3 as long as I don't move my mouse or cursor to that position. Very nice, indeed!

    Another feature request (not sure if it's been there or not). Whenever Unity do a script reload, backup a copy of changed C# files so I can retrieve it when needed. I've just lost one of my editing scripts because of power failure :( Luckily, I was able to retrieve the previous version from the unity compiled .dll (some of work lost and all local variable names messed up, of course). I'd prefer to have auto backups to restore from :)

    I got a problem on my Mac (never happens on my Win). It's quite rare and hard to reproduce but I encounter at least twice. UnityEditor sometimes fail to detect script changes and SI3 also did not detect it. After that when the Editor recompile, somehow my script got overwritten and I lots my edits. It might because of my Unity (5.5 beta) or my Mac but maybe you could watch out for that :)
     
  42. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Hey @Flipbookee,

    - A few weeks ago, based on my suggestion (which is awesome and thanks again!) you added a feature to open the unity script reference regardless of whether it found unity symbols. It works like a charm! However, I found it to not work with functions. Would it be a lot of effort to add that functionality to whatever is selected (even functions and classes and namespaces), instead of only selected text inside functions?

    - Have you considered adding a 'refactor' option to the context menu of a function or variable? Every once in a while, I want to rename a variable for consistency, and the process is pretty clumsy: rename a public variable, rename it everywhere in the component itself, then save, wait for compile and the errors, then go down the list of errors of 'variable doesn't exist', then save, wait for compile + editor compile and the errors, then go down the list again, fix errors, save, done. An alternative to this would be a refactor option, and it would work like this: right mouseclick on a variable / function > refactor > type the new name > hit return. done. What do you think?

    Thanks again for this amazing plugin! Did I write a good review yet? Let me write a good review.
     
    Flipbookee likes this.
  43. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Actually, I have a couple of other things to say about your plugin! I wrote these for my review on the asset store, but then realised this was a much better place to put these, so I removed them there. I hope you'll consider working on these!

    - on maxOS, you have to install an additional package to make the shortcut keys fully work. Would have loved to see this as an integrated part of the plugin itself.
    - I'm not a fan of any of the color scenes... but sort of got used to one I don't like much. Any way I could maybe make one myself?
    - Saving a Si3 window in Unity's saved layout will open up an empty window upon loading a different layout. yeah... what can you do about that?
    - the checkmarks in the settings of the script view in the inspector don't show, so you're toggling settings 'in the blind', not knowing whether you're turning them on or off.

    I hope this is useful feedback!

    EDIT: more thoughts on the script view in the inspector.

    - why? why is it there? the inspector takes up unnecessary space at the top and bottom of the panel, making it less attractive to code in, it disappears upon selecting anything else, and whenever there is a error, selecting it in the console wouldn't open it in the script view in the inspector. So... maybe it should go, or get a full implementation, but not the half-baked implementation it is now ;)
     
    Last edited: Nov 23, 2016
    Flipbookee likes this.
  44. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hey @_Adriaan, thanks for the amazing review and all your feedback! :cool:

    I'm not sure I understand that... Can you give me example of classes and methods where that is not working?

    I've been working on Rename Refactoring for a while already. Yes, it will a great time saver, I know... It's one of the most demanded features and once it's finished it will be released as Si3 version 3.1 :)

    Yes, I know that would be nice, but that's not my own code and I can't take the responsibility if anything goes wrong with it. I was considering to include the keyboard plugin (and give credits to @inventor2010, of course), but I've received two reports of Unity crashes related to the latest version of the plugin and Unity 5.4... I don't know is that a bug in the plugin or is it a newly introduced bug in Unity, but the crash was somehow related to the auto-repeat simulation code in the plugin which didn't exist in the previous version, so I'd advise you all to switch to that older version for now and until this bug gets solved... You can download that version from here:
    https://www.dropbox.com/s/7cjpr9xfr2a23dj/SI_+_Real_Mac_Hotkeys_Rev2.zip?dl=1

    Yes, all the color themes are defined in FGTextEditor.cs - just search for all occurrences of the name of one of the existing ones, duplicate that code and add your modifications. Or even better, wait for the next release because all the color themes were extracted out of that script by @Novack, so adding your own themes will be much easier and they will not get overwritten by updating Si3. And of course, if you add a nice theme consider sharing it with me so I can include it with next update. :)

    Whoops, I'll check that - thanks man!

    Yes, I know about that... It was intentionally one like that because of a some weird limitations in Unity, but I'll check if there's some better solution.

    Yes, maybe it should go and get replaced with a list of symbols defined in that script? It's there because of historical reasons - in Si1 it was the only type of view since it was only a viewer and it served as a replacement for the default inspector for script and text assets - therefore the name Script Inspector... ;)

    Extremely useful, thanks a lot! :cool:
     
    Novack likes this.
  45. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Thanks a lot for getting back to me and really good to hear that nearly all my concerns are being addressed. I'll definitely be in touch with you here on the forums again about some of the things I've said, once you release 3.1!

    For instance, this function doesn't have the 'Unity Script Reference' option: (lol and don't mind the errors, I was in the middle of making this script haha)



    or here:



    And I've encountered various other cases where the Unity Script Reference wasn't an option. You see; I'd love to be able to call for the Unity Script Reference at any time, whatever I have selected in the script.

    Does this help?
     
    Last edited: Nov 24, 2016
    Flipbookee likes this.
  46. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Thanks @_Adriaan, I see... You're right, the first case is a magic method and since those are not defined in any of the Unity own assemblies, Si3 assumes this is not a Unity symbol and it doesn't offer Unity Scripting Reference for that. That's wrong and Si3 should act smarter here and recognize it's a Unity magic method and still offer the help page for that! It can also offer a direct link to the page describing that method instead of going to the search results page. :cool:

    Now in the second example you're right-clicking a local variable in your own script and searching Unity Scripting Reference for "item" wouldn't make sense because there will be no results. :p However, the type of that local variable is probably AudioClip which is a Unity type, so then maybe you should get an option to see the documentation page for the type AudioClip? I'll try adding that, it sounds like a good thing to have, but please note that type of the variable item is "defined" in the var keyword already, so you can also right-click that and access Unity Scripting Reference for the AudioClip class. I'm mentioning this because it isn't too obvious and you may not expect that Si3 knows what that var stands for ;)

    So, I hope that explains why Unity Scripting Reference is not always accessible, and in my opinion it shouldn't be for symbols that have nothing to do with Unity. But that's just me, let me know if you don't agree - I can add a configurable list of always accessible search providers and fill it with the most useful ones by default: Unity Scripting Reference, MSDN .Net Reference, stackoverflow.com etc... :)
     
  47. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Once in a while I forget the name of a Unity variable or method and the quickest way for me from code to the script reference was to write a keyword, select, [Cmd] + ['], and I would often see it in front of me right away. Even though this might not make sense to you, it did work for me with MonoDevelop and it does yield results.

    I'm not sure I understand why this is your opinion! I would always hit [Cmd] + ['] for a reason, right?
     
    Flipbookee likes this.
  48. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    @Flipbookee : I think you should keep the menu item but can disable it when it's not applicable. Normally users will remember where a function is, not what the text is saying. Removing items from context menu depends on context may sound "smart" at first sight but actually not a good idea in UX world. It makes users feel more annoying as they need to read the text and search for the function they want :)
     
    Flipbookee likes this.
  49. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Yeah, I see... :)

    Well, Cmd-' is a shared shortcut that may also have to go to MSDN .Net Reference. Si3 resolves the symbol and finds out where it's defined, then based on that it decides where to find its documentation. If it's a Unity symbol then opens Unity Scripting Reference; if it's a .Net symbol then it goes to MSDN. If it's a local variable then none of those two can help, so that's my reasoning - why would you look for documentation of your own symbols on Unity Docs or MSDN?

    But your previous point kind of makes sense, so I think I'll have to add that list of predefined and user-defined search providers...

    On a side note and as a bonus, I could also add a list of documentation websites for other assets. :) If their symbols are isolated in a .dll or namespace then I can easily "see" they belong to that asset and go straight to their docs websites! :cool:
     
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,793
    Hehe yeah, you're right. Yes, I shouldn't be removing and adding menu items, so I'll change that, but I'd still like to modify their text so they say different thing in different context, but still do very similar things and share the same keyboard shortcut. I do that for example with Cut and Copy that change to Cut Line and Copy Line if nothing is selected. :cool:

    Note: Cutting and copying full lines when there's no selection needs to be allowed in Si3 Preferences:
    upload_2016-11-24_15-40-8.png
     
    Novack likes this.