Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Collapsed functions suddenly expanded

Discussion in 'Editor & General Support' started by Chris_St, Jul 19, 2023.

  1. Chris_St

    Chris_St

    Joined:
    Apr 25, 2018
    Posts:
    19
    Hi.

    For a week now i have a weird problem.
    It happens in one of my scripts (and only in this one).
    I have about 20 functions in there and for better navigation i have collapsed them all.
    Worked well for some weeks but now it already happened 3 times that suddenly all
    functions are expanded. Of course it's not a big problem and it's fixed in a minute, but
    as you can guess it's pretty annoying clicking the small "-" 20+ times.
    And somehow it's only in this script, the others also have many collapsed functions but they
    stay that way.

    Any ideas would be much appreciated :)

    P.S.: forgot to mention, i use Visual Studio 2019
     
    Last edited: Jul 19, 2023
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,874
    This is not a unity issue, this is a visual studio issue. Contact Microsoft or Microsoft forums, its not made by unity so its got nothing to do with this forum.
     
    Chris_St likes this.
  3. Chris_St

    Chris_St

    Joined:
    Apr 25, 2018
    Posts:
    19
    You're right, should've thought of that. Thanks for the clarification.
     
    MadeFromPolygons likes this.
  4. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    702
    Could be related to clicking on error links in the Unity console. Those will expand functions to show the error.

    Try posting here:
    https://forum.unity.com/forums/code-editors-ides.783/

    I have been frustrated by this too sometimes, but there are so many reasons why it might be happening I never bothered to find out how to avoid it, or if it is a bug.
     
  5. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    702
    I think i figured it out.

    If you do a search for a term in the script, it will unhide all functions with that term in it.

    That's for current document. If you search entire project, it might unhide all functions in the entire project with that term.
     
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,082
    You could check settings (Tools -> Options -> Settings -> Search "collapse") to see if anything is toggled that goes against what you would normally want. There is a shortcut to rapidly expand everything: CTRL+M then CTRL+X. If you want to change this shortcut it's called "Edit.ExpandAllOutlining".