There is such an extension in VS: TeX Comments and the example:
I wonder if it's possible to do this in VS Code?
Comment Formula is a newer extension which supports this. So far, it seems to work quite well:
While editing that line, you see:
While not editing that line, you see: