VSCode has a comment API For some reason it's basically unused and unusable without an interfacing extension. Here is such an extension. This is basically the comments sample with workspace-local persistence added.