Thanks for the quick reaction and fix!
I can confirm that the error is not happening anymore.

Maybe unrelated, how do I know when the process is finished?. I've waited 30 minutes and my computer is using quite some resources. I do see this in the status bar:

thank you for the confirmation!

oh, nice .. "Processing NaN" will be fixed. Although this processing itself supposes to take a few seconds. May I ask what is your project structure? Do you have a "vendor" folder at the root of your workspace?

Thank you

    Yes I do have a vendor folder, and some others. Is there a way to exclude some?

    The only option I find in the settings is phpTools.license.

      How do I know that indexing is done? In the PHP Language Server output tab I see this:

      PHP Tools server started.
          Path: /Users/adrimbp/.vscode/extensions/devsense.phptools-vscode-1.4.7520/out/server/Devsense.PHP.LanguageServer.dll
          PID: 54962
          Processing files: .php; .php5

        I let it run for a while and see this in the logs

        [Info  - 9:33:09 AM] Connection to server got closed. Server will restart.
        
        PHP Tools server started.
            Path: /Users/adrimbp/.vscode/extensions/devsense.phptools-vscode-1.4.7520/out/server/Devsense.PHP.LanguageServer.dll
            PID: 57238
            Processing files: .php; .php5
        
        [Info  - 9:52:31 AM] Connection to server got closed. Server will restart.

          The Processing ... status information signalizes the indexing is happening in the background.

          Anyways; the problem is Connection to server got closed. Server will restart. - this means the server has crashed and indexing will start all over again. Would you have any additional information? It might be in Help/Toggle Developer Tools, Console Tab.

          Thanks!

            Now I got this one. However I didn't see any logs in the console.

            PHP Tools server started.
                Path: /Users/adrimbp/.vscode/extensions/devsense.phptools-vscode-1.4.7520/out/server/Devsense.PHP.LanguageServer.dll
                PID: 87119
                Processing files: .php; .php5
            
            Stack overflow.
            Repeat 4656 times:
            --------------------------------
               at Devsense.PHP.Syntax.TreeVisitor.VisitBinaryEx(Devsense.PHP.Syntax.Ast.BinaryEx)
               at PHP.VisualStudio.Language.Nodes.Validation.BasePhpAnalysis.VisitBinaryEx(Devsense.PHP.Syntax.Ast.BinaryEx)
            --------------------------------
               at Devsense.PHP.Syntax.TreeVisitor.VisitArrayEx(Devsense.PHP.Syntax.Ast.ArrayEx)
               at PHP.VisualStudio.Language.Nodes.Validation.BasePhpAnalysis.VisitArrayEx(Devsense.PHP.Syntax.Ast.ArrayEx)
               at PHP.VisualStudio.Language.Nodes.Validation.Php80Analysis.VisitActualParam(Devsense.PHP.Syntax.Ast.ActualParam)
               at Devsense.PHP.Syntax.TreeVisitor.VisitList[[Devsense.PHP.Syntax.Ast.ActualParam, Devsense.PHP.Parser, Version=8.1.7517.0, Culture=neutral, PublicKeyToken=840d8b321fee7061]](System.Collections.Generic.IList`1<Devsense.PHP.Syntax.Ast.ActualParam>)
               at Devsense.PHP.Syntax.TreeVisitor.VisitFunctionCall(Devsense.PHP.Syntax.Ast.FunctionCall)
               at PHP.VisualStudio.Language.Nodes.Validation.BasePhpAnalysis.VisitFunctionCall(Devsense.PHP.Syntax.Ast.FunctionCall)
               at Devsense.PHP.Syntax.TreeVisitor.VisitList[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IList`1<System.__Canon>)
               at PHP.VisualStudio.Language.Nodes.Project.ProjectAnalysis.AnalyseNodeNoLock(PHP.VisualStudio.Language.Nodes.Ast.GlobalCodeNode)
               at PHP.VisualStudio.Language.Nodes.Project.ProjectAnalysis.AnalyseNode(PHP.VisualStudio.Language.Nodes.Ast.GlobalCodeNode)
               at Devsense.PHP.LanguageServer.QueueBase`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InvokeSafe(System.__Canon)
               at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForWorker>b__1(System.Threading.Tasks.RangeWorker ByRef, Int32, Boolean ByRef)
               at System.Threading.Tasks.TaskReplicator+Replica.Execute()
               at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
               at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
               at System.Threading.ThreadPoolWorkQueue.Dispatch()
            [Info  - 1:38:08 PM] Connection to server got closed. Server will restart.

            awesome! thank you!

              We're just releasing the update that fixes the issue.

              Thank you!

                Next one :)

                PHP Tools server started.
                    Path: /Users/adrimbp/.vscode/extensions/devsense.phptools-vscode-1.4.7534/out/server/Devsense.PHP.LanguageServer.dll
                    PID: 13104
                    Processing files: .php; .php5
                
                Stack overflow.
                Repeat 8132 times:
                --------------------------------
                   at Devsense.PHP.Syntax.TreeVisitor.VisitBinaryEx(Devsense.PHP.Syntax.Ast.BinaryEx)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitElement(Devsense.PHP.Syntax.Ast.LangElement)
                --------------------------------
                   at Devsense.PHP.Syntax.TreeVisitor.VisitArrayEx(Devsense.PHP.Syntax.Ast.ArrayEx)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitElement(Devsense.PHP.Syntax.Ast.LangElement)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitActualParam(Devsense.PHP.Syntax.Ast.ActualParam)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitList[[Devsense.PHP.Syntax.Ast.ActualParam, Devsense.PHP.Parser, Version=8.1.7517.0, Culture=neutral, PublicKeyToken=840d8b321fee7061]](System.Collections.Generic.IList`1<Devsense.PHP.Syntax.Ast.ActualParam>)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitFunctionCall(Devsense.PHP.Syntax.Ast.FunctionCall)
                   at PHP.VisualStudio.Language.Nodes.Frameworks.AliasesFrameworkResolver+AliasesVisitor.VisitDirectStMtdCall(Devsense.PHP.Syntax.Ast.DirectStMtdCall)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitElement(Devsense.PHP.Syntax.Ast.LangElement)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitElement(Devsense.PHP.Syntax.Ast.LangElement)
                   at Devsense.PHP.Syntax.TreeVisitor.VisitList[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IList`1<System.__Canon>)
                   at PHP.VisualStudio.Language.Nodes.Frameworks.AliasesFrameworkResolver+ProjectAliasesCache.GetNodes(Devsense.PHP.Nodes.Project.IFileInfo)
                   at PHP.VisualStudio.Language.Nodes.Project.ProjectTablesCache`2[[PHP.VisualStudio.Language.Nodes.Frameworks.AliasesFrameworkResolver+AliasInfo, Devsense.PHP.Nodes.Implementation, Version=5.0.0.0, Culture=neutral, PublicKeyToken=17116b35d45f8bb8],[Devsense.PHP.Syntax.QualifiedName, Devsense.PHP.Parser, Version=8.1.7517.0, Culture=neutral, PublicKeyToken=840d8b321fee7061]].project_NodeUpdated(Devsense.PHP.Nodes.Project.IFileInfo, System.String, PHP.VisualStudio.Language.Nodes.Project.ContainerUpdateFlags)
                   at PHP.VisualStudio.Language.Nodes.Project.ProjectContainer.FireNodeUpdated(Devsense.PHP.Nodes.Project.IFileInfo, System.String, PHP.VisualStudio.Language.Nodes.Project.ContainerUpdateFlags)
                   at PHP.VisualStudio.Language.Nodes.Project.ProjectContainer.UpdateNode(Devsense.PHP.Nodes.Project.IFileInfo, System.String, PHP.VisualStudio.Language.Nodes.Project.ContainerUpdateFlags)
                   at Devsense.PHP.LanguageServer.Project.WorkspaceProject.UpdateFile(Devsense.LanguageServer.Utils.ClientUri, System.String, PHP.VisualStudio.Language.Nodes.Project.ContainerUpdateFlags, Devsense.PHP.LanguageServer.Project.VersionStamp)
                   at Devsense.PHP.LanguageServer.Project.WorkspaceProject+ParseQueue.Invoke(Data)
                   at Devsense.PHP.LanguageServer.QueueBase`1[[Devsense.PHP.LanguageServer.Project.WorkspaceProject+ParseQueue+Data, Devsense.PHP.LanguageServer, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5b4bee2bf1f98593]].InvokeSafe(Data)
                   at Devsense.PHP.LanguageServer.QueueBase`1+<>c__DisplayClass15_0[[Devsense.PHP.LanguageServer.Project.WorkspaceProject+ParseQueue+Data, Devsense.PHP.LanguageServer, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5b4bee2bf1f98593]].<Worker>b__0(Int32)
                   at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForWorker>b__1(System.Threading.Tasks.RangeWorker ByRef, Int32, Boolean ByRef)
                   at System.Threading.Tasks.TaskReplicator+Replica`1[[System.Threading.Tasks.RangeWorker, System.Threading.Tasks.Parallel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].ExecuteAction(Boolean ByRef)
                   at System.Threading.Tasks.TaskReplicator+Replica.Execute()
                   at System.Threading.Tasks.TaskReplicator+Replica+<>c.<.ctor>b__4_0(System.Object)
                   at System.Threading.Tasks.Task.InnerInvoke()
                   at System.Threading.Tasks.Task+<>c.<.cctor>b__277_0(System.Object)
                   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
                   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
                   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
                   at System.Threading.Tasks.Task.ExecuteFromThreadPool(System.Threading.Thread)
                   at System.Threading.ThreadPoolWorkQueue.Dispatch()
                   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
                [Info  - 5:17:36 PM] Connection to server got closed. Server will restart.

                thank you, the fix will be in the next update!

                  5 months later

                  JakubMisek Has this been fixed yet? I'm running into the same issue on my Laravel project.

                  The issue seems to be related to projects with large dependencies, when I remove the vendor folder, the indexing step runs smoothly (with many errors of course shown in the IDE since it can't find the deps).

                  Coincidentally, this issue is also causing the extension to crash Visual Studio 2022, I attached the activity log for you to look at, so it's not just an issue with VSCode.
                  This issue is actually stopping me from switching over from JetBrains to Visual Studio, I prefer VS as an IDE.

                  activitylog.xml
                  2MB

                    @6h4n3m thank you for the details!

                    We have fixed related issues already, but this is a new one. We'll try to fix it asap.

                      We have fixed this one; will be ready in the next update.

                      Although even we have tested large codebases by ourselves, it is possible there will occur a similar problem somewhere else - in such a case - we'll be glad for the stack traces again.

                      Thank you!

                        JakubMisek Much appreciated, will this be available in 1.61.15267 or the update after that?

                          JakubMisek Issue is fixed, much appreciated (only tested Visual Studio 2022, didn't know how to get the preview version for VS Code).

                            Thank you for the confirmation!

                            Version for VSCode will be released soon

                              VSCode update has been released.

                              I hope it will work for you! Thank you for reporting the issue, and for any other feedback.