Search Unity

Utilities Script Inspector 3

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

  1. schplurg

    schplurg

    Joined:
    Mar 21, 2009
    Posts:
    208
    Once again, I can't load my Unity layout. I used these steps to fix it and I can't get Si3 to appear in Unity.
    1. Save your Layout
    2. Uninstall Si3
    3. Load the default Layout
    4. Update Si3
    5. Load your Layout again
    Is there some file I'm missing when I remove Si3 from Unity? I see it in Plugins\Editor. I delete the Si3 folder then empty the trash on my Mac. I can't get the Si3 console tab to appear and when I select a script there is no option to use Si3 to open it.

    I'm getting console errors: "Error while reading window layout...."

    I never had this happen before Si3 and quite frankly it's a big pain. This is the third time it's happened.

    Anyways, my project is days away from completion so any help getting Si3 going again is appreciated.

    ETA:
    I've tried this 4 or 5 times and I can't get Si3 working again. I can only think I'm not removing some part of it from Unity but...???

    ETA 2:
    So I started using Monodevelop again, and suddenly Si3 console appeared after about 20 minutes. What the...? I guess I'm glad but...?
     
    Last edited: Oct 27, 2015
  2. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Woah @schplurg! That's really strange :confused:

    All Si3 components are inside Plugins/Editor/ScriptInspector3 so removing that folder fully removes Si3 from a project if there are no script errors somewhere else. What is your Unity version and OS? If this happens again please try to create and a new empty project and then import Si3 only. If any part of Si3 still doesn't work, please zip the whole folder of that new project and send it to me. This should help me track the issue.

    When you say "can't get Si3 to appear in Unity" is that only about the SI Console tab or also when you double-click a script? What happened when a script is selected, did you see Si3 to appear in the Inspector?
     
  3. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Just a friendly remind about my most wanted features for SI3 right now would be :
    - Auto Import
    - Find & Replace
    - Refactor -> Rename variable / method

    Really hope that you can nail them down soon :)
     
    Flipbookee likes this.
  4. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
  5. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Auto import is that SI3 will write the using xxxx; for me automatically :).

    And even better if SI3 priority based on the using order when help resolving ambiguous class import. If I have something like this on the top of my CS file

    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    then if I write Debug.Log then SI3 will help me to import using Debug = UnityEngine.Debug; so help resolve ambiguous reference to System.Diagnostic.Debug

    when I write Object, SI3 will help me to add using Object = UnityEngine.Object instead of using system.Object

    when I write Random, SI3 will help me to add using Random = UnityEngine.Random instead of using system.Random

    Hope it clear enough :)

    I don't know if scan all the namespaces to find the correct class to import automatically will slow things down or not. In that case, I would like to have a priority list of import statements so I can tweak it and SI3 will only need to scan and auto import from that list from top to bottom, and it would be excellent to me as I can then control the priority of the import statements...

    Thanks a lot man :) Absolutely Great Job !
     
    mcmorry likes this.
  6. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Hey @thienhaflash, I see, auto import is already planned, but adding "Using X = UnityEngine.X" automatically will make that even greater! :cool:

    Thanks for the great idea!!!

    All the types are scanned only once in the beginning and this is quick because there are not that many types. Also because scanning goes through assemblies that are already loaded in the current .Net domain, this is very quick. Scanning the members happens during the semantic analysis phase and it's "on demand" - only members used in the current script will be scanned, and semantic analysis is always trying to do as little work as possible, so it only runs for the symbols which are visible on the screen and almost nothing more than that! :) This is one of the reasons why Si3 can open any script from the current project almost instantly! :) Once auto-completion is triggered for a type, all of its members will be scanned of course, but now this is also fast because it's only about one type (and its base types, but some of them likely have already been fully scanned; for example object is the base class for every type).
     
    mcmorry likes this.
  7. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    And bad news for today,

    This time occurs when I delete a field from a class then F12 on one of its usage in the same file

    Code (CSharp):
    1. ArgumentOutOfRangeException: Argument is out of range.
    2. Parameter name: index
    3. System.Collections.Generic.List`1[ScriptInspector.SyntaxToken].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    4. FGTextBuffer.GetTokenSpan (Int32 lineIndex, Int32 tokenIndex) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2418)
    5. FGTextBuffer.GetTokenSpan (ScriptInspector.Leaf parseTreeLeaf) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2404)
    6. FGTextBuffer.GetParseTreeNodeSpan (ScriptInspector.BaseNode parseTreeNode) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextBuffer.cs:2426)
    7. ScriptInspector.FGTextEditor.GoToSymbolDeclaration (ScriptInspector.SymbolDeclaration declaration) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:9594)
    8. ScriptInspector.FGTextEditor.GoToDefinition () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:7035)
    9. ScriptInspector.FGTextEditor.ProcessEditorKeyboard (UnityEngine.Event current, Boolean acceptingAutoComplete) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:7240)
    10. ScriptInspector.FGTextEditor.DoGUI (Boolean enableGUI) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:3455)
    11. ScriptInspector.FGTextEditor.DoGUIWithAutocomplete (Boolean enableGUI) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2760)
    12. ScriptInspector.FGTextEditor.OnWindowGUI (UnityEditor.EditorWindow window, UnityEngine.RectOffset margins) (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGTextEditor.cs:2618)
    13. ScriptInspector.FGCodeWindow.OnGUI () (at Assets/Plugins/Editor/ScriptInspector3/Scripts/FGCodeWindow.cs:1069)
    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-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
    Flipbookee likes this.
  8. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Ah, this looks like a really good find :)
     
  9. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    I really love Script Inspector3, but there is one thing that drives me crazy. Does it bother anyone else how indentation works when an if-statement is on multiple lines? Like this...

    Code (CSharp):
    1.  
    2. if(someStuff
    3.      && otherStuff) {
    4.      return true;
    5.      } else if(whatever) {
    6.           return false;
    7.      }
    8.  
    Notice how the "else if" statement gets indented to the same indentation as the return statement. I definitely think the "else if" stuff should be indented the same as the "if"

    Thanks.
     
    Flipbookee likes this.
  10. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Oh @breakspirit, I didn't know about that! :eek: I always put my opening curly braces on a new line and then it works fine...

    So, thanks for reporting the issue! It will be fixed. ;)
     
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    @breakspirit This would be the expected indentation, right?
    Code (csharp):
    1.  
    2. if(someStuff
    3.      && otherStuff) {
    4.      return true;
    5. } else if(whatever) {
    6.      return false;
    7. }
    That return true; statement gets lost in the noise... I guess this is why I like it more when the opening braces are on a new line :rolleyes:
     
  12. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123
    @Flipbookee
    Hey, found a new bug, sorry

    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3.  
    4. public class Test : MonoBehaviour
    5. {
    6.     void Start()
    7.     {
    8.         gameObject.playTween(true, delegate
    9.         {
    10.         });
    11.     }
    12. }
    13.  
    14. static class Utils
    15. {
    16.     public static void playTween(this GameObject gObject, bool forward = true, Action<GameObject> callback = null)
    17.     {
    18.     }
    19. }
    If you copy this code into a script you get an error in SI3 but not an error in Unity. I'm sorry to bother you with these extension methods, they are not bothering me as much as not having format code does, but I hope this will come up soon (^-^) . Keep up the good work!
     
    Flipbookee likes this.
  13. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    @Victor_Kallai, you're right and I just learned something new about C# - the anonymous method "delegate {}" is actually convertible to any delegate type that returns void regardless how many parameters are declared for that delegate type as long as none of them is an "out" parameter! This is a bit different than lambda expressions where the parameters must match the delegate type... Anyway, I don't think anonymous methods are handled correctly in Si3 as it is with lambda expressions, so I'll have to fix this and thanks a lot for the report! Replacing the "delegate { }" part with "x => { }" will make this code recognizable for Si3, but yeah, that's not really a solution, just a temporary workaround, so fixing this in Si3 is still needed. ;)
     
    Victor_Kallai likes this.
  14. breakspirit

    breakspirit

    Joined:
    Aug 11, 2013
    Posts:
    30
    @Flipbookee Yeah, that indentation is exactly what I'd expect. Thanks!
     
    Flipbookee likes this.
  15. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    @Flipbookee, I've been using Script Inspector for a couple weeks now and, as you know, I've been loving it.

    But just now I felt a need for a little debugging... which makes me sad. My choices are to either launch MonoDevelop for the first time in weeks, or go old-school and use a bunch of Debug.Logs instead of actual debugging.

    Is there any possibility of adding debugging support to Script Inspector?

    I know "debugging support" is kind of broad, so here are the specific features I would love to see:
    1. Ability to set a breakpoint on any line.
    2. When the game is paused, show me the code it's paused on, along with values for local variables, and the call stack.
    Really, those are the key bits — there are a bunch of other nice-to-haves (such as dropping into the debugger when an exception is thrown, an "immediate mode" window that evaluates expressions you enter, and the ability to pause when a script is stuck in an infinite loop), but I could live without those in a first version. If I just had breakpoints and inspection of local variables, I could do 95% of what I ever need a debugger for. I just need to see what's going on!

    Thanks for considering, and keep being awesome!
     
    Flipbookee likes this.
  16. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I found another "dammit, don't replace my correct code with incorrect code" moment. :)

    I have a class called ProjectNode, which contains an enum called MajorBenefit (and a public property of that type named benefit). I'm trying to type:

    Code (CSharp):
    1.         Color c = colors.Get(proj.benefit);
    Here, colors.Get is of course a method that takes a ProjectNode.MajorBenefit.

    But as soon as I type "proj", the autocomplete pop-up is suggesting ProjectNode.MajorBenefit, and as soon as I press ".", it fills it in with:

    Code (CSharp):
    1.         Color c = colors.Get(ProjectNode.MajorBenefit.)
    I'm not sure what went wrong here, but something sure did, because I didn't type that and certainly don't want it. And it's hard to fix too, because as soon as I delete it, retype "proj", and hit the dot again, it just does it again. Super frustrating (until I remember to hit Esc to cancel the autocomplete popup before it strikes).
     
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    So far I've managed to integrate the debugger with Si3 and succeeded in attaching it to a running standalone build. I've also managed to set and remove a breakpoint on a specific line, monitor when it gets hit and executions gets suspended, and then resume the execution when I want. All this seemed to be fairly simple, so I believe building a fully featured debugger is not that hard.

    There's only one limitation with that approach - the debugger can't attach to itself which means we can't debug the game running in Editor with this, unfortunately... I could dive into debugger's code and see if I can do anything about that, but that would be a very long shot... A much easier approach would be to run another instance of Unity with Si3 in it and debug from there. I don't know how useful would that be since we'll still have to wait for that other instance to run and open a project, but it might be a bit faster than doing that with MD, and possibly more stable.

    There's another alternative, but it's more complex and more limited - I could for example inject an (invisible) method call at the location of the breakpoint that captures the values of all local variables at that point and either records them in a trace buffer for inspection between frames while game is paused, or that method call could tell Si3 to open a modal window with all of its UI so that the execution of the game code will be suspended, waiting for the modal Si3 window to close.

    The complicated part of this approach is that it requires code injection, but that has already been done (by others, not me ;)) so this is one of the possible solutions. If I can find a way how to handle SIGSEGV signal notifications sent by the system to Unity, that would make this approach much easier and more practical, but if not, then there are alternatives to that as well...
     
  18. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Is the "proj" completion listed in that context? It sounds like it is not, otherwise Si3 would have selected it. So if that's the case then I'll need to know what's the relation between that context and the "proj" symbol, pretty please :)
     
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
  20. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Well, I tried a couple of guesses, but these all worked fine for me... So I need to know what is the declaration of "proj", the method in which this happened and what is the relation between these two.
     
  21. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    It was listed, but not selected. Here's what it looks like as soon as the autocomplete popup pops up:



    'proj' is a parameter. So I guess the problem is that it knows "proj" is a valid completion, but even though it's an exact match, it prefers ProjectNode.MajorBenefit for some reason.
     
    Flipbookee likes this.
  22. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Ugh. You're right, that greatly limits its utility.

    So the problem is that the debugger works through a local socket or pipe or some such? And the same process can't both listen and connect on the same port?

    What if you made a little external process that simply acts as a socket relay? So (just making numbers up here), you connect to your custom process on port 1234, and it connects to Unity on the standard debugging port (5678 or whatever). Your process does nothing but forward all the traffic in both directions. Unity just sees an ordinary external debugger connected on port 5678, and your code essentially sees an application running on port 1234.

    You might have to write that little forwarding app separately for Mac and Windows, but I bet you could find plenty of volunteers here. (I'll step up on the Mac side if you can't find someone better qualified to do it.)
     
    Flipbookee likes this.
  23. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Oh, I see! This has something to do with the enum type expected as an argument. The suggested enum type seems to have higher priority of the exactly matching word, which is wrong. This was a rare coincidence :p I guess I would never find this by myself, great that you reported it! :)
     
    JoeStrout likes this.
  24. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    I'm not an expert for sockets, but I'd guess a process can run a service on a socket and connect to it as a client at the same time. Or am I wrong?

    The problem would more likely be that the debugger explicitly forbids attaching to itself as that wouldn't make sense. Any attempt to suspend the execution of its own threads would be silly. But not all threads get suspended, at least the one for running socket connection has to remain active, so there might be a mechanism there to select which threads get suspended or not.

    Anyway, either I or @inventor2010 had the same idea as you, to have an external process that simply forwards traffic from one socket to another, but still this may not work because (almost) all Unity Editor threads will get suspended. Even if that's the case, modal windows may still work ;)

    So, I think that running a second Editor instance is the simplest and most promising approach, and I guess the first approach to try... once I get back to debugging...
     
  25. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Call for HELP! :)

    As you all know 3.0.9 was supposed to be released yesterday with the new Replace All feature, and as usual I missed my own time estimate :p not because of that feature - Replace All is done and working, but because of the Global Undo/Redo which was supposed to accompany Replace All to safeguard your work from accidental destruction of your projects ;)

    At first I thought Global Undo/Redo will be a trivial thing, and it is for simple cases when it would be executed right after a Replace All, but things get really complicated if there are additional changes made after a Replace All! Doing a Global Undo after undoing those changes made afterwards is not an issue, but I don't know what to do in cases when Global Undo is not possible because of those changes?

    So I thought it would be the easiest for me to just search the web and see how other editors are handling this... and... Surprise! All I found is that most of the editors don't even handle this!

    https://github.com/atom/find-and-replace/issues/331#issuecomment-126833569

    Most of them just display a big warning message asking you to backup your projects and verify correctness of your find and replace fields :), except Visual Studio that has these Global Undo and Redo commands, but even for VS all I found is people complaining how Global Undo has destroyed their projects!

    I had a similar bad experience in the past and I've never used Replace All since then, therefore I have almost no experience with this feature (I use Rename all the time, but that's much safer). So, I need a little bit of help from those brave ones who are not afraid to use Replace All - What's your good or bad experience with Replace All? Do you know of any IDE to have this done right? What would be your ideal way of doing Replace All and being able to undo or redo that?
     
  26. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Ok, this will not help you too much, but the use of Replace All is a bad practice. Refactoring is the way to go. So IMO a big scaring warning message is more than enough.
     
    Flipbookee likes this.
  27. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    I'm not sure I even understand the problem, you have your undo queue and additional changes made after that needs to be undone first. Unless we're talking about users using another editor to F*** stuff up (moving files outside of unity so the guid changes and stuff like that) in which case they're asking for it.
     
    Flipbookee likes this.
  28. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    No, no! The problem is when multiple files are affected with only one Replace All, then Global Undo means undo all those changes at once. Now if all those individual undo buffers are at a matching position there's no problem, there's only a problem if one or more of them have subsequent changes so that Global Undo can't be applied. Undo can fall back to a local undo then with a warning message maybe. Then a Redo will get that buffer in synch and an Undo in the other buffer may get the other buffer in synch, so then Global Undo may work at that point again...

    There's a similar issue with the Global Redo but from the opposite side of those undo buffers.
     
  29. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Here's how I see it.
    • If you have a multi-file search & replace that doesn't let you see what's being replaced before you do it, this is a Bad Thing and should never be used.
    • If instead you make the user do a Find All, showing all the search results in a scrolly list as you do now, and let them select which matches to replace — then this is much safer, and is a feature I would actually use.
    • I would open a tab for each file you do any replaces in (if it's not open already of course), and not save the changes to disk. So you get a bunch of dirty open documents, each with its own Undo buffer.
    Yeah, this means that the user who says "oh crap, I shouldn't have done that!" now has to either close without saving, or Undo in each of those documents. That's OK. It's a rare situation and what to do about it would be obvious; the extra 60 seconds hitting Undo in each document is not going to be a big deal.

    And think about the most likely way this goes wrong: it's when the user hasn't paid attention to the scope. They were thinking about files A, B, and C, and when they did the search they saw those come up, so they just hit Select All and Replace, and only then realize that the search string matched in completely unrelated files D, E, and F. Fortunately you've made it really obvious, because they now have unexpected tabs D, E, and F open!

    So they don't want to undo the whole operation anyway — they only want to revert files D, E, and F. So they go to those tabs and close without saving. Or, if they had them open, they go to each of those tabs and Undo. Easy peasy.

    In short: forget about Global Undo/Redo. Keep it on a per-file basis, and just open a dirty tab for each file affected.
     
    Flipbookee likes this.
  30. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Oh, there is an option to do this in my current implementation... Shall I remove it? :confused:

    It has this too and it's the default option. :D

    This is currently optional, but I see your point, maybe it shouldn't be.

    This is the simplest solution so far that should work, unless we notice that those changes don't compile after saving them all :p
     
  31. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    (Re. replacing all without first showing the matches...)
    Yeah, honestly, I would rather you did just remove it. It's an exceedingly dangerous thing to do. And if you remove it, not only is it less code for you to maintain, it's less stuff your poor users (us) need to read, understand, and consider. Sometimes less options == better.

    (Re. showing all matches and letting you decide which to replace...)
    That's awesome sauce on a bed of super noodles.

    Yeah, it's unfortunate that in this environment we can't compile unsaved files. And yes, I've actually worked in an environment where that's not the case (REALbasic — which, full disclosure, I helped create). But that's really unusual; almost every other dev environment is file-based, and testing your code means saving it to disk.

    So, that's why the undo buffer is so important... but still fine on a per-file basis.
     
  32. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Hmm, interesting! :rolleyes: We can have the same thing with Si3, if that's somehow useful.
     
  33. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    YAY! Si3 just learned a new trick - Global Undo and Global Redo :D (okay, two tricks but related)

    Which then puts it at least one step in front of Atom, Webstorm, Sublime Text, Brackets, Textmate 2, Notepad++, Chocolat (never heard of that one? Me neither), and VS Code. MonoDevelop as well, of course (by the way, don't try that - MD will do all the changes directly in the files on your drive with no undo at all or any warning!). Notice, VS is not in this list ;)

    I could have just skipped this part as you guys suggested, but then I wouldn't like to use the Replace All feature. I also realized that the Rename refactoring wouldn't be cool if it doesn't come with a nice and easy undo like this! :) But thanks for all your advices and suggestion that helped me to turn my brain on! :D
     
    Last edited: Nov 11, 2015
    mcmorry likes this.
  34. Wompipomp

    Wompipomp

    Joined:
    Aug 31, 2014
    Posts:
    24
    Hi,

    Great tool :)
    Do you also plan to support vertex and fragment shader? I saw that there is no highlighting or similar.

    Cheers
    Mark
     
    Flipbookee likes this.
  35. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Congratulations! I didn't think that also rename refactoring could benefit from this solution.
    And yes... MD is very dangerous. I speak by experience :eek:
     
    Flipbookee likes this.
  36. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Thanks Mark! :D

    Yes, ideally there will be auto-completion for ShaderLab, CG and HLSL, but currently there's only syntax highlighting for ShaderLab. Adding syntax highlighting for CG and HLSL and adding auto-completion for ShaderLab is easy, while auto-completion for CG and HLSL is a bit more complicated but still way easier than it was for C# ;)
     
    Wompipomp likes this.
  37. Wompipomp

    Wompipomp

    Joined:
    Aug 31, 2014
    Posts:
    24
    Wow. Highlighting for CG would be great. Auto completion would be fantastic. :) I am looking for a good alternative for VS for writing shaders. Although it has highlighting it always wrecks up my indentation and formatting which is quite annoying.
     
    Flipbookee likes this.
  38. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Breaking news! ;)
    Script Inspector 3 - version 3.0.9
    is available now for download from the Asset Store

    And this is the change list:
    - Replace in Files with ability to preview and select which occurrences to replace
    - Global Undo/Redo after Replace in Files
    - New cursor navigation mode that matches OS X text editing apps (optional, customizable, and even available on Windows) - thanks @JoeStrout
    - New alternative shortcut for Duplicate Line(s) on OS X: Alt-Cmd-Down arrow
    - New scope option for Find/Replace in Files: Current Tab
    - Go to method overload definition - thanks @mcmorry
    - Edit-in-memory dialog now shows the filename
    - New hotkey: Alt+M (Ctrl-M on OS X) opens the last code navigation breadcrumb button - thanks @CaptainCatnip
    - Optional non-aggressive auto-complete mode that only accepts completions with the Tab key - thanks @JoeStrout
    - Auto-complete doesn't insist on accepting completions where lambdas are expected - thanks @JoeStrout
    - Type parameter constraints are now used in resolving members and in auto-completion - thanks @thienhaflash
    - Fixed NullRef while resolving overloads of a method with params parameter
    - Fixed NullRef on toggling maximize tab
    - Fixed NullRef in resolving interfaces on a constructed generic type
    - Fixed conversions of constructed generic types - thanks @bocs
    - Fixed NullRef in GetTokenSpan - thanks @thienhaflash
    - Fixed opening shaders with Open Any File dialog - thanks @Sarper Soher
    - Fixed resolving of pre-increment-expression and pre-decrement-expression
    - Fixed the "multiple managers" warning - thanks @jrDev
    - Fixed auto-generating override methods in some edge cases
    - Fixed NullRef in Go to definition
    - Fixed updating text buffers in some rare cases after Undo or Redo
    - Fixed Unity Scripting Reference links for generic symbols
    - Fixed arguments hints so that they remain hidden after hiding them with Esc key - thanks @thienhaflash
    - Fixed selection priority of exactly typed names of auto-completion list items - thanks @JoeStrout
    - Fixed expected argument type for extension methods
    - Fixed keyboard handling in Tab Switcher if CapsLock or NumLock is on
    - Changed on OS X to avoid conflicts: Controlling SI tabs with Alt-Ctrl-Left/Right arrows instead of Alt-Cmd-Left/Right on OS X

    Thank you for all your great suggestions and bug reports! :D

    Happy coding! :cool:
     
    radimoto, JoeStrout and baby_jeans like this.
  39. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    Update is awesome, been using it for the past hour or so and already made some use out of the Replace functionality! Seems to work great!

    I do still seem to be having some problems with the Alt-Tab functionality on OSX though. I can't reliably get it to keep the window open, and I end up juggling between two files most of the time. I've started to become accustomed to just using the Open Any File dialog to get back to the files I want though... which admittedly is what I usually did with VS2015 anyway (well, with VAX).

    Thanks a ton for the update though!
     
    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    @CaptainCatnip Is your OS X a virtual machine running on Windows maybe? :confused:
     
  41. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123
    Thanks for the update! Any news on the next big features? Like format document, find all references and refactoring?
     
    Flipbookee likes this.
  42. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @Flipbookee and ... customizable shortcuts? :p
     
    Flipbookee likes this.
  43. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Yes, I've started that already, but it's a huge task. I'll continue with that, but it may take some time until finishing it. :-\

    Find All References is the first next big thing because that's relatively simple and very useful. Also Rename, because that's more or less only a Find All References followed by a Replace All ;)

    Code formatting is also very simple, but it requires a lot of typing. :p

    I'll put up a Trello board soon so you can all see what's the plan and eventually vote for the features you'd want to see first :cool:
     
    Victor_Kallai likes this.
  44. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    Oh no, it's an 11" MacBook Air 2012 running El Capitan. I was wondering, since there's Alt+Ctrl+Left/Right if there might be away to actually switch to left/right tabs rather than move them as an alternative to the Alt-Tab? It really isn't that big of a deal though, I'm habitually used to using the Open Any File by now ;)

    Again, thanks a ton for the update. Did some more work this morning before my day-job, and I'm pretty much in love with Si3
     
    Flipbookee likes this.
  45. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    You are doing a great work. Keep going!
    And Trello is definitely a good idea.
     
    Flipbookee likes this.
  46. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    Hehe, thanks @mcmorry and @CaptainCatnip! :D

    Alt-Ctrl-Left/Right arrows are switching to the SI tab on the left or right. Is that not working for you? To reorder the tabs and move them left or right you have to also press Shift with these shortcuts. Is that working?
     
    baby_jeans likes this.
  47. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    Ah! I didn't realize this. I had those bound to "Move a space left / right" for Mission Control, but I usually just 3-Finger swipe for that anyway. I unbound 'em and this will work perfectly. It's more what I wanted over Alt-Tab, too.

    If you do want any more info about what's happening with Alt-Tab for me, let me know, but as far as I'm concerned I'm perfectly fine with Open Any and the Ctrl+Alt+Left/Right
     
    Flipbookee likes this.
  48. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    @CaptainCatnip, That's cool then :)

    Now if you can find some other remapping related to Alt-Tab too that would be perfect :p or otherwise I'd need your help to understand what's going on exactly ;)
     
  49. baby_jeans

    baby_jeans

    Joined:
    Sep 1, 2015
    Posts:
    34
    I figured it out! My SI3 tabs are in a window that I also put the Find Results tab on, and the Game tab on. Since I couldn't Ctrl+Alt+Left/Right to those tabs, I had a sneaking suspicion they also were causing the alt-tab issue. When I made a new Window with just SI3 tabs, Alt+Tab worked perfectly fine.
    So the issue really was that I'm mixing SI3 Tabs with non-SI3 tabs.
     
  50. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,796
    @CaptainCatnip Thanks for the explanation! I think I understand now. The thing that must have confused you is that the Alt-Tab only works when one of the Si3 windows has the keyboard focus. Similarly Ctrl-Alt-Left/Right works only when a SI code tab has the focus. This is because the keyboard events are only passed to the focussed window, but I could eventually handle those events globally using my FGKeyboardHook class on Windows or @inventor2010's plugin on OS X. That way you could easily Alt-Tab from any window to any other window in Unity, not only between Si3 windows! :cool: