a year later

I have a similar problem. The PHP Language server keeps crashing and is subsequently being shut down: "The PHP Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.". The last two days it worked with the same project. After upgrading VSCode to 1.74.3 I'm back to the language server crashing after every startup of VSCode. I'm working on an M1 Pro MBP with macOS 12.6.2. What do you need from me in order to be able to help?

derfony thank you! I'll try to release the fix within today

    derfony we have fixed the code that causes this; however, we don't have any reproducible test cases.

    Basically, there will be a very long expression in your workspace; I'd assume a string concatenation (thousands of .) or another binary operator. This is probably in some generated PHP code.

    We'll try to make such code and test the rest of the extension to see if it survives.

    11 days later

    JakubMisek Thanks for your reply. I'm working on TYPO3-projects using Docker and DDEV. TYPO3 generates PHP-files that it caches in a temporary directory that resides withinside the workspace root. I tried emptying the respective folder (as it will be regenerated once any of the TYPO3-code is called anyway) and this helped me to start VSCode without the PHP Language Server crashing.

      3 months later

      derfony thank you for the update, and for the stack trace!

      I'll try to fix it within the next update.

        derfony Do you have the latest version, we should have fixed that on January '23 :/

          JakubMisek Thanks @JakubMisek for again looking into the issue. I have version v1.26.11866 installed, from January 9th.

            JakubMisek My VSCode tells me there are no extensions to update. Weird. Will look into that, thanks for your help!

              JakubMisek I'm now running 1.33. For the moment it has resolved the issue. Naturally I'll keep an eye on it. Many thanks for your quick support!

                derfony thank you for trying the update, I'll be happy for any other feedback :)

                  JakubMisek Hi Jakub, here's another stack trace: https://zerobin.net/?9462ce76ce9dec98#stFm2QvzXpvRSsvFbzsEJ5n/ys1n2CIwQ+vLunmq35c=

                  As you can see in the trace, I'm now running 1.33.12934. So what happens? For the workspace I'm working on I set "php.problems.scope": "user", and also set "files.watcherExclude" to "**/var/**": true, (as this is the directory, that while running the TYPO3-installation using ddev and docker will contain generated code) although I'm not sure this has any effect on the php tools. After starting VSCode with this workspace files will now be scanned quietly in the background, the number of files that contain problems like calls of deprecated functions and are marked in the filebrowser grows, as does the number of problems in the problems tab of the bottom panel. Now when I open any php file the language server crashes. When I scroll through the file the server crashes again and again until it is eventually shut down.

                  derfony Thank you! will be fixed

                  note for me:

                     at Devsense.PHP.Syntax.TreeVisitor.VisitBinaryEx(Devsense.PHP.Syntax.Ast.BinaryEx)
                     at Devsense.PHP.Refactoring.Visitors.ContextVisitor.VisitElement(Devsense.PHP.Syntax.Ast.ILangElement)
                    9 months later

                    Hi @JakubMisek ,

                    I also stumbled across a similar issue, starting randomly yesterday evening.
                    The only thing I can imagine that might has a relation to this is adding javascript to my project. However, I don't belive this is the problem.

                    I am currently running on a trial for the premium, as I thought about buying the full license, but this was activated today because I thought the issue might be related somehow with not being premium.

                    https://bin.uhl.cloud/?08352741bfa11a40#8GriUVd9wnXTk963A13KXVNtb3KA5iY42Uzqb95BAUVu

                    Would be nice to get a quick support on this one :).

                    // Luca

                    LucaWelker thank you very much for the log; I'll take a look if we can fix it quickly.

                      LucaWelker just released pre-release 1.42.14700 which fixes related issues; it should fix this one as well.

                      Please let me know if it helps. Thanks!