Hi @A T ,
Restart your windows and sql service and have a test?
Do you test with other PCs? And the same issue?
Follow steps as this to open one .sql file: https://learn.microsoft.com/en-us/sql/ssms/menu-help/open-with-new-file?view=sql-server-ver15#:~:text=You%20can%20open%20a%20document,and%20then%20click%20Open%20With.
Do you test with other SSMS version? Download the latest SSMS to have a test: https://learn.microsoft.com/en-us/sql/ssms/release-notes-ssms?view=sql-server-ver15#186
BR,
Mia
If the reply helped, please do “Accept Answer”.