@juliusmarminge as mentioned on #21532: this is that PR's behavior ported to current main. #21532 now conflicts in nine files, and its client half calls resolveProviderForCwd, which #24058 deleted as dead code, so it cannot be rebased mechanically.
The rebase notes and the verification are in the description. I could not request you as a reviewer from a fork, hence the mention.
If you would rather keep #21532 as the landing point, close this and I will delete the branch. No offense taken.