VSCode hanging with HA Dev Container

I know this is not a VSCode forum but I thought I would post here as most likely to be people with similar setups that maybe have a similar issue and know of a fix.

So, the basic problem I have is that I get continual freezes of the VSCode instance while using HA dev container under Debian 12 ina VBox environment. I see it hammering the disk (so much so, that the whole Debian environment freezes waiting for access to the disk).

Sometimes I get a VSCode not responding message and if I manage to click close (and it closes when there is some availability to the disk queue), everything frees up again. In most cases, I have to power off the machine through VBox menu (or machine crashes itself). It does not seem to do this with any other VSCode instance I have running.

I only really do HA development with VSCode, so am usually running a few VSCode instances with one being the HA Dev Container.

A bit more about my setup.

Running VBox 7.0.20 with extensions installed in the Debian 12 install
AMD Ryzen 9 3900X 12 core system with 24 virtual cores, 12 allocated to the Debian VM
Total 16GB RAM with 8GB allocated to VM
Windows 11 on host

I used to have an Ubuntu VM to do HA Dev but moved to Debian as had the same issue in that environment and I just thought it needed rebuilding so started with a fresh Debian install. However, the issue has followed.

Has anyone else experienced this and found a solution as it’s driving me nuts!

I experience the same from time to time.
It seems to be the linting that cause it, especially with larger files.

I run lovelace_gen and the small difference in the YAML/Jinja2 code from traditional HA YAML/Jinja2 code makes at time go haywire.
It feels a cascading effect where the first “found” error will push it off its normal path and everything after that just spirals out of control.

Hmm…I could handle from time to time but I can basically do about an hours work after VM start up before it does it. I have left it sometimes for 10 mins or so and it has finished whatever it is doing bt then it will happen again later. Othertimes, it never recovers (or maybe I just get fed up of waiting) and it needs a forceable restart or the VM reboots.

Other than obviously all the HA files in the dev container, I am not working with particularly big files.

I did suspect it was maybe it loading its cache for typing support and the number of HA files is causing it a problem but then I would have thought most people developing for HA would experience this and there would be a lot of noise about it (either here or on VSCode forums/github issues) but seemingly not.