You can Add Visual Studio editor support for another language.
VS2022 uses TextMate Grammars for this, which seems to support comments, so you can add a new language with files of extension ".txt" or ending with "CMakeLists.txt" and set wraps of #
and \n
as its comment wrapper.
There is a textmate tag, if you struggle implementing that.