I have been running into this issue recently with VS Enterprise 2022 v17.5.X and noticed something I thought I would share, in case it helps someone else. The short version is an invalid FK reference appeared to be causing the issue (resolving this typo/build error resulted in the analysis completing immediately).
Details:
Usually just giving it a few minutes or restarting VS would resolve the problem and let me get back to work. However, this time I was in the middle of changes when it happened and nothing seemed to help.
In a last ditch effort, I pushed my changes through our build server just to validate the build and hopefully be able to deploy these latest changes without the help of VS. The deployment revealed a typo in the name of one of the foreign key constraints (defined in a separate FK script file in the project). This invalid column reference caused the build to fail. The interesting thing is after fixing this issue, the issue where VS was stuck analyzing the database schema cleared almost immediately and I could once again build.
It could have been a coincidence, but given the amount of time I had spent on the issue until then, it doesn't seem like it. If you are encountering this issue in newer VS versions and have recently made/are making changes, it may be worth validating there are no schema errors.