Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Script Inspector 3 - World's Fastest IDE for Unity - ⭐️⭐️⭐️⭐️⭐️

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

?

What would you like to see in the next update?

Poll closed May 17, 2018.
  1. Line numbers

    140 vote(s)
    36.9%
  2. Code folding

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

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

    71 vote(s)
    18.7%
  5. Search functionality

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

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

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

    BrokenAngel

    Joined:
    Mar 24, 2013
    Posts:
    92
    Hi I was just download the plugin and got some considering about usage so I want to ask 2 question :

    1) I try to use it with this like of code

    upload_2020-11-29_16-10-28.png

    is there anyway it will auto-spacing for me like in Visual Studio

    upload_2020-11-29_16-12-10.png

    2) One more problem is when I type something like this
    upload_2020-11-29_16-13-25.png

    I don't see it help me to search reference in other .dll

    upload_2020-11-29_16-16-13.png

    Thanks.
     

    Attached Files:

    Flipbookee likes this.
  2. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    122
    Thanks for the help. Using Ctrl worked for me.

    About the right-clicking, just to clarify, I tend to right click on the component in the inspector and use the menu here:
    upload_2020-11-30_6-9-40.png
     
    Flipbookee likes this.
  3. yonson_chappers

    yonson_chappers

    Joined:
    Feb 6, 2017
    Posts:
    28
    silly question hopefully, but where is the error reporting? i.e. in visual studio all error lines are marked in red making it easy go through. Can't see this in Script Inspector, can someone advise please?
     
    Flipbookee likes this.
  4. Semi_sus

    Semi_sus

    Joined:
    Dec 2, 2020
    Posts:
    3
    I still don't understand why node based visual shader editors became a big deal and got promoted by Unity in the past but Si3 is not getting any love. Maybe people always have this experience where the internal IDE's suck in any game engine and automatically think that if you are serious about programming you need a dedicated IDE. It's hard to get people to adopt new tech and applications, especially developers, if they already have an alternative they have been using for 5+ years.
     
    Flipbookee likes this.
  5. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    122
    for me it's underlined in purple:

    upload_2020-12-2_8-33-48.png
     
    Flipbookee likes this.
  6. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    @BrokenAngel, Si3 cannot do auto-formatting at the moment, but it's planned to be added. It has auto-indentation though.

    The ToDictionary extension method is defined in the System.Linq namespace, so you'd have to add "using System.Linq" to make that method accessible in the script. Once that's added, Si3 will use it and show autocompletion for ToDictionary. That's the same as in Visual Studio.
     
  7. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Right, I understand. Edit Script is a Unity built-in command that Si3 overrides and either opens the script in Si3 or in the external editor, depending on how it's configured, while the Edit in Script Inspector command is added by Si3. The issue is that this second command should become Edit in External IDE when Si3 is set as the default script editor, so I'll do that.
     
    tchris likes this.
  8. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    @yonson_chappers and @tchris, Si3 highlights syntax errors in red and semantic errors in purple.

    Syntax errors are the ones found by the C# parser, things like missing semicolons, mismatched parentheses, malformed expressions, or missing keywords or keywords used in a place they are not expected. These errors prevent the Si3 parser to represent the code in form of a syntax tree around those errors.

    Si3 finds and highlights all syntax errors. It must find all those errors because the syntax tree it produces is needed for the next phase - semantic analysis.

    Semantic errors are the ones found during semantic analysis, things like using an undeclared variable, invoking unexisting methods, trying to use an undefined type, etc.

    Si3 finds some of the semantic errors, but not all of them. It finds those semantic errors that would break the semantic analysis, like using an undefined symbol. It also finds some other errors that won't break the semantic analysis, but are easy to be identified without affecting the performance. It won't find highlight a semantic error like using an uninitialized variable because that's not trivial to find and that error doesn't break the semantic analysis of the rest of the code.

    You may wonder why Si3 works like that? Why it doesn't highlight all the semantic errors? Sorry for the very long post, skip the rest of it if you don't care, or keep reading if you want to know the answer:

    After representing the code as a syntax tree, Si3 has to do a semantic analysis of that tree to understand the meaning of each symbol name by resolving it as a reference to its symbol definition. This is the most complex part of the Si3 code. It took me years to write that part from scratch.

    The syntax analysis and the semantic analysis of the code is similar to what the compiler does, just more complex in Si3 because it has to do those tasks incrementally, which means as you edit the code, Si3 won't do that for the whole script because then it would be too slow in a very long script. Instead, Si3's incremental parser prunes the syntax tree and rebuilds only the parts of it affected by editing. Then the incremental semantic analyzer does something similar, it removes the symbol definitions affected by that editing and replaces them with new definitions, then tries to resolve the newly added symbol names in the syntax tree. The incremental parser and semantic analyzer are what make Si3 the fastest IDE in the world. :cool:

    Now see, writing a C# parser, and especially a C# semantic analyzer from scratch is an incredibly complex task. Writing an incremental parser and an incremental code analyzer are even more complex tasks! There are many semantic errors and warnings in C# that are not critical for editing the code and I believe I wouldn't be able to make Si3 work by now if I tried to write bespoke code that identifies each of them. That's why Si3 doesn't highlight some of the non-critical semantic errors, but the compiler will find them.
     
    tchris likes this.
  9. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    So true!
     
    Lars-Steenhoff likes this.
  10. Terko

    Terko

    Joined:
    Apr 20, 2013
    Posts:
    32
    Hey! I’ve just purchased your asset. It’s very quick and I like it.

    One issue:
    - Is there a way to make GoToDefinition jump straight to the definition without opening the menu with tons of references (that takes quite a while on my old mac to even build that menu)?
    Since GoToDefinition is supposed to quicken the development, this menu breaks the whole point of it.
     
    Flipbookee likes this.
  11. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Are you asking about the "go-to member" menu that opens from the navigation toolbar or the context menu on right-click where the "Go to Definition" command is?

    On Mac, F12 or Cmd-Y will go to definition (then press that again to return the cursor back). But I guess you're asking about the menu for members from the navigation toolbar. I'm planning to replace that menu with a list similar to the autocompletion popup window (and we would be able to type there to narrow the list). Until then, I guess the best alternative is to search with Cmd-F or use quick-find next/previous occurrence of the word under the cursor with Shift-Cmd-Up/Down arrows or Shift-Ctrl-Up/Down arrows. At least that's what I use even on Windows, and I also use Alt-Left/Right arrows extensively to move the cursor through the previous/next locations - it's often much quicker for me to do that than searching or using the go-to member menu (this also works across multiple files, so it saves a lot of keystrokes).
     
  12. Terko

    Terko

    Joined:
    Apr 20, 2013
    Posts:
    32
    Ok, so for some reason on Mac:
    Cmd-Y is doing Find All References instead of Go To Definition. (Should be a bug I tested on 2 machines)
    F12 is doing Go To Definition and it is fast.

    Thank you!
     
    Flipbookee likes this.
  13. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Whoops, I see, that's a bug. Cmd-Y should do a go-to definition... Thanks, I'll fix that.
     
  14. nicksnels

    nicksnels

    Joined:
    Jun 6, 2014
    Posts:
    2
    After importing Script Editor in Unity 2020.1.8f1 on Windows 10:

    I get multiple warnings:
    Code (CSharp):
    1. Menu Window/Panels/1  can't be checked because it doesn't exist
    2. UnityEditor.EditorApplication:Internal_InvokeTickEvents()
    And 1 error:
    Code (CSharp):
    1.  
    2. EndLayoutGroup: BeginLayoutGroup must be called first.
    3. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    4.  
    How can I fix this? Thanks.
     

    Attached Files:

    Flipbookee likes this.
  15. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    @nicksnels, both, the warning and the error are coming from Unity Editor's internal code, and I can't fix their code... But I've found a workaround for the warning! :) It will be released with the next update, and till then, please do this simple change in Si3 code:

    1. Open the FGPopupWindow.cs script (press Alt+Shift+O to open any script, then type a small part of the script name to narrow the list, select FGPopupWindow.cs with the Up/Down arrows, and press Enter).
    2. Go to line 124 in that script (press Ctrl+G, type 124, and press Enter). You should see this method:
    Code (CSharp):
    1.     protected static T CreatePopup<T>() where T : FGPopupWindow
    2.     {
    3.         ++allowNextPopups;
    4.         T popupWindow = CreateInstance<T>();
    5.         return popupWindow;
    6.     }
    7.  
    3. Change this method so it has an extra line before the return statement like this:
    Code (CSharp):
    1.     protected static T CreatePopup<T>() where T : FGPopupWindow
    2.     {
    3.         ++allowNextPopups;
    4.         T popupWindow = CreateInstance<T>();
    5.         popupWindow.titleContent.tooltip = "Si3 Popup Window";
    6.         return popupWindow;
    7.     }
    8.  
    4. Save the change and let Unity recompile Si3 and reload its domain assemblies.

    That's it, the warning shouldn't appear anymore. :cool:

    I haven't seen that error though. I'll investigate, but let me know is it happening only once on import or later as well? Can you see a pattern in what triggers the error?
     
  16. nicksnels

    nicksnels

    Joined:
    Jun 6, 2014
    Posts:
    2
    Thank you very much for the quick fix! I implemented it. No more warning for the moment. I'll keep you posted if I get any more warnings.

    Earlier today, before implementing the fix, I also got a warning with "Menu Window/Panels/2" in it.

    The error occurs when I imported your plugin. Today I restarted my project and I didn't receive the error.
     
    Flipbookee likes this.
  17. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Hey, hey! Some good news for you, my friends:

    Script Inspector 3
    version 3.0.27

    is available in the Asset Store now
    New in version 3.0.27:
    - C# 5.0 to C# 7.3 support:
    * async and await contextual keywords
    * Null-conditional ?. operator
    * Expression-bodied methods, constructors, finalizers, properties, property getters and setters, indexers, indexer getters and setters, and event adders and removers
    * Initializers for auto-implemented properties
    * String interpolation
    * Fixed the nameof operator
    - New option to control auto-indenting in text assets - thanks @bobueland
    - Workaround for resizing autocomplete list - thanks @haywirephoenix
    - Fixed Cmd-Y binding on Mac for Go To Definition - thanks @Terko
    - Fixed unintended autocompletion on declaring local variable names starting with 'a', 'i', or 'n'
    - Fixed out of range exception on pinging non-existent line
    - Fixed warnings about "Window/Panel/1" not existing

    Enjoy! :cool:
     
    haywirephoenix, realcosmik and jrDev like this.
  18. realcosmik

    realcosmik

    Joined:
    Nov 27, 2018
    Posts:
    21
    awesome work thanks so much! I just downloaded glad to see these features added. I noticed that some of the features added in c# 7 suite that allow you to pass struct by address with greater flexibility give compile errors (in param, and readonly ref returns). readonly structs compile fine though. Any chance those could get added? Thanks again, getting real sick of these sluggish and bloated IDE's

    Code (CSharp):
    1.  ref readonly int priority = ref newResponse.GetPriority();
    Code (CSharp):
    1.  void Readstruct(in LargeStruct l)
    2. {  
    3. }
    Code (CSharp):
    1.  private ref readonly LargeStruct GetBigStruct()
    2. {
    3.    return ref bigStructMember;
    4. }
     
    Last edited: Dec 14, 2020
    Flipbookee likes this.
  19. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Yes, ref values will be next after “using static”.
     
    zigguratt and realcosmik like this.
  20. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Also the “in” parameters - missed that in your post.
     
    realcosmik likes this.
  21. Ksanone

    Ksanone

    Joined:
    Feb 7, 2015
    Posts:
    13
    Hi thanks for making Script3.

    Not sure if its a bug on my end or to do with Script3 but I have this flickering issue with Intellisense. The same thing does not happen with VS.

    Any advice would be great.
     

    Attached Files:

    Flipbookee likes this.
  22. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    That’s a weird issue. I haven’t seen that. Is it happening often? It would be best if I find a way to reproduce that, so please tell me what version of Unity and OS you use, because it may be something specific to that particular combination (otherwise I’d have seen this issue by now).
     
  23. Ksanone

    Ksanone

    Joined:
    Feb 7, 2015
    Posts:
    13
    Unity 2019.4 LTS, Windows 10 updated. I have PowerToys with fancy zones but turning that off doesn't affect it. It is hard to reproduce the issue as it only happens sometimes, the trigger is unclear.

    It is probably an issue on my end but thought I'd post in case it was a known issue.
     
    Flipbookee likes this.
  24. haywirephoenix

    haywirephoenix

    Joined:
    May 17, 2017
    Posts:
    89
    I have the same issue 2019.4.17f1 LTS. The whole Si window including the tabs flashes black with every refresh.

    Just created a new project and it seems to be only happening with Vulkan. Disabling the popup stops it from happening, I hope this helps narrow it down!

    @Ksanone Is your default graphics api set to Vulkan by any chance?
     
    Flipbookee likes this.
  25. Ksanone

    Ksanone

    Joined:
    Feb 7, 2015
    Posts:
    13
    No, I had to look up Vulkan API in fact. Thanks anyway though.
     
    Flipbookee likes this.
  26. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    18
    I co
    I can confirm I have experienced this with Vulkan also.
     
    Flipbookee and haywirephoenix like this.
  27. haywirephoenix

    haywirephoenix

    Joined:
    May 17, 2017
    Posts:
    89
    If it helps it also does it with Dx12 set to default.
     
    Flipbookee likes this.
  28. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    haywirephoenix likes this.
  29. BradZoob

    BradZoob

    Joined:
    Feb 12, 2014
    Posts:
    55
    FGTextEditor.cs# Line 30
    Change this:
    #if UNITY_2019_2_OR_NEWER
    To this:
    #if UNITY_2019_1_OR_NEWER

    It's inconsistent with a catch for 2019_1 further down that will raise 3 errors about the missing UIElements component if you're using 2019.1.x.
     
    Flipbookee likes this.
  30. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Hey @Flipbookee, I can't seem to update the asset using the Package Manager. It says the correct version but it doesn't import the new version. What should I do?

    Thanks,
    jrDev
     
    Last edited: Jan 17, 2021
    Flipbookee likes this.
  31. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,985
    delete the package cache, and download again

    Its a package manager bug
     
    jrDev and Flipbookee like this.
  32. jrDev

    jrDev

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

    Where do I find that cache?

    Thanks,
    jrDev
     
    Flipbookee likes this.
  33. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,985
    jrDev and Flipbookee like this.
  34. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    I had the same issue a few days ago. I was trying to download the latest Si3 version, 3.0.27, but I got 3.0.25. I restarted Unity and tried again and I got 3.0.15, which was 3 years old. I tried restarting Unity a few more times and I found even Script Inspector 2 added to my test project. Eventually, I managed to download and import the latest by doing that. I didn't know I could delete the cash to save time.

    @jrDev, I can send you a copy of the latest version, if that helps?
     
    Lars-Steenhoff likes this.
  35. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Please do!

    Thanks,
    jrDev
     
    Flipbookee likes this.
  36. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,985
    #78

    Unity will fix this in the next versions

    2021.1.0b3
    2020.2.3f1
    2019.4.19f1
     
    Flipbookee and jrDev like this.
  37. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Hey @Flipbookee,

    I don't know if this is already possible but is there a shortcut I can use to comment out ONLY what I highlight selected?

    Thanks,
    jrDev
     
    Flipbookee likes this.
  38. erlemaitre

    erlemaitre

    Joined:
    Oct 30, 2018
    Posts:
    24
    Hello,
    I'm currently working with platform dependent compilation, especially the #if UNITY_EDITOR directive. The issue is that I would like to edit the #else statement of this directive, but the entire block is treated as a comment (no syntax highlighting, no auto-completion...) Is there a way to have all the features, even if the directive is not active ?
     
    Flipbookee likes this.
  39. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Hello,

    Is anyone using Unity 2020.2.2f1? I am getting severe slow down it's practically unusable. @Flipbookee?

    Edit: Not script inspectors fault. I had a script selected and because its a big script with all the variables displayed in the inspector, it was slowing to a crawl.

    Thanks,
    jrDev
     
    Last edited: Jan 26, 2021
    Flipbookee likes this.
  40. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Oh, okay. My heart stopped for a bit ;)

    I can add that for selections on a single line. Would that be enough?
     
  41. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Currently no, so as a workaround, temporarily inverting the condition, in that case #if !UNITY_EDITOR, may help. In some cases, for example, if this #if block depends on other #if blocks in the same or some other scripts, that may not be enough, and that's why I haven't made this work automatically... But I'll think about this and I'll try to come up with something better than having to temporarily invert the condition.
     
  42. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,745
    Sure that’s start. Is it hard when my selection goes into another line?
     
    Flipbookee likes this.
  43. erlemaitre

    erlemaitre

    Joined:
    Oct 30, 2018
    Posts:
    24
    Thank you for your answer, I'll take the workaround for now. And thank you for the amazing asset! :cool:
     
    Flipbookee likes this.
  44. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    No, it isn’t hard, just we’d need a different keyboard shortcut then. For selections in a single line, it could do what you want with the current shortcut and if there’s no selection or when it spans over multiple lines it would work as it does now.
     
    jrDev likes this.
  45. BenniKo

    BenniKo

    Joined:
    Mar 24, 2015
    Posts:
    92
    The assetstore page says "Code generators for override methods".
    But how do you actually use that?
    I cannot find infos about that in the readme.
     
    Flipbookee likes this.
  46. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Oh yeah, just type 'override' and space after that - the autocompletion list opens up with every overrideable method listed in it.

    Methods already overridden in that class won't be listed, and if all methods are already overridden the autocompletion list won't show up, which makes this feature a bit harder to discover. I'll mention this in the readme.txt :)
     
  47. BenniKo

    BenniKo

    Joined:
    Mar 24, 2015
    Posts:
    92
    Thanks! I found it :)
     
    Flipbookee likes this.
  48. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    214
    @Flipbookee Please support .jslib, .jspre, .js, and .c files. These are used for WebGL plugin development. Wonderful asset by the way. A must have one, so much better than using an external IDE.
     
    Flipbookee likes this.
  49. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,501
    Hey, hey! There's a present for you waiting to be picked up ;)

    Script Inspector 3
    version 3.0.28

    has just been released on the Asset Store
    ...and this is what you'll find in it:
    - C# 5.0-7.3 support:
    * using static directive
    * "in" parameters
    * expression-bodied operators
    * "when" in catch statements
    * pattern matching in switch statements
    * ref returns
    * local ref variables
    * ref assignments
    * conditional ref expressions
    * ref structs
    - Fixed flickering autocomplete list - thanks @Ksanone & @magnox7
    - Fixed compile errors in Unity 2019.1 - thanks @BradZoob
    - Fixed parsing explicit implementation of indexers in generic interfaces - thanks @qiwulun
    - Fixed "word stops" on non-ASCII letters - thanks @zeiksz
    - Fixed auto-indent when it's disabled - thanks @ahp275
    - Fixed tokenizing preprocessor directive argument - thanks @Sarinen
    - Fixed invalid argument exception on right-click - thanks @Sarinen
    - Fixed an index out of bounds exception
    - Fixed unnecessary delay when typing the first character
    - Fixed Monospaced Font button in SI Console

    And while you're there, please consider doing me a tiny favor - a nice review is going to mean the world to me :)

    Enjoy! :cool:
     
  50. jensen_305

    jensen_305

    Joined:
    May 15, 2018
    Posts:
    25
    Just installed this for first time. Code is valid. All the out RaycastHit stuff has this behavior.
     
    Last edited: Mar 25, 2021
    Flipbookee likes this.
unityunity