jeHawWebdesign It's possible, I've noticed even though the PHP outlining is disabled, VIsual Studio adds it's own outlining, and incorrectly :/

    5 days later

    Good news, the VS Team just contacted me and requested I do that Submit Video and Logs functionality so they can find out what is happening.

    I told them what you said about turning PHP outlining off and it still outlining, and that they should contact you for more information if they need it.

    I'll keep you posted.

      jeHawWebdesign awesome! thank you very much for the updates and for talking to the VS team.

        6 days later

        Good Morning,

        The thread was just updated, they found the error, something to do with PHP Tools. Here is their answer:


        Thanks for your feedback. After our FTE investigated it was thought to be an issue with the PHP tool, as he saw a related error in ActivityLog.xml:
        <entry>
        <record>1961</record>
        <time>2024/02/22 07:41:58.756</time>
        <type>Error</type>
        <source>PhpLanguage</source>
        <description>Language Block Manager, VsTextViewCreated fail: Value cannot be null. Parameter name: serviceManager</description>
        </entry>
        “Language Block Manager” failing sounds like something that can cause collapsible regions to not behave as expected.

        I found out that you had already submitted the issue (#Region Auto-Collapsing on File Open - PHP Tools Community Forum | DEVSENSE) in PHP Tool’s official website. So go ahead and let the PHP group investigate to resolve your issue.


        Hope that helps, the original can be found at the link I provided earlier.

          Just making sure you saw this...

            Thank you for the update, and for keeping in touch with all of us)

            We'll check if it's related.

              As a quick workaround, I would suggest disabling #region/#endregion outlining in Tools/Options/Text Editor/PHP/Advanced.

              We're looking into it.

                It seems this only happens if you open .php files without having a project/solution.

                Without a solution, Visual Studio doesn't save the outlining state and doesn't restore it properly after reopening the file. Since #region is collapsed by default, Visual Studio always collapses it.

                Also, without a project/solution, most of the features just won't work.

                Is this the case?


                In this case,

                • it's always better to use projects or open a folder (File / Open / Folder)
                • don't delete .vs directory created by Visual Studio - it contains the region's collapsed state
                • or eventually, we can create an option to not collapse #region by default

                  The project is opened using the start window through an .sln solution file. (*.sln)
                  The .vs directory is intact.

                  Still collapses automatically.

                    jeHawWebdesign

                    I guess, the .php file is a part of the project?

                    I can't repro the issue, but I can change the defaults, so region won't get collapsed implicitly - will be done or configurable in next update.

                      5 days later

                      JakubMisek Sorry for the late reply, things got very hectic for the last few days. Many thanks, appreciate the effort.

                        jeHawWebdesign Thank you for the reply, I hope everything is OK.

                        I'll prepare a new update soon, it won't collapse #region by default.

                          13 days later

                          It works, too well. After setting it to false:

                          If all regions are collapsed and I open one region to work on it, then either close the file and then open it or close VS and then restart it, all regions are expanded.

                          Thanks for trying though.

                          The offending VS update (17.9.0) has caused a lot more problems than just this, interface changes without justification, collapsed TypeScript / JavaScript regions not showing tags, etc., they really did a job on this one.

                            jeHawWebdesign At least, we expand the regions by default, so you can see the code :) although, as you said, this needs to be handled by VS (fixed in a future update of VS). In some cases, it just forgets the state of the regions.

                              15 days later

                              I tried deleting that last post. It worked for all of one session. The moment I closed VS and reopened it later, the problem had returned.