better-comments
better-comments copied to clipboard
How can I get this extension to work in `.csv` and `.txt` files?
I really like using this extension everywhere in VSCode
I work with .csv files allot and it would help allot if I can make notes in such files using this extension.
I have tried to get it working on my own but failed. Thing is .csv files dont have a comment symbol
Is there any chance for this?
Thanks!
PS: I know that even if I managed to get it working that commenting in .csv files will break the files integrity but its okay, I have a solution for that.
Add this line to your settings.json:
"better-comments.highlightPlainText": true,
That will enable highlighting in any file without a defined comment. You simply type the tag as the first non-whitespace character, and from there it will apply the same styling as it would after a comment in other languages.
Hey. Thank you so much for getting back to me on this. I finally had some time to try your solution.
Sadly it does not seem to be working. "better-comments.highlightPlainText": true, is present in my settings and vscode is reloaded but when I try to use a tag in csv or plain text files. I dont get any highlighting. I recorded an example for you:

I suspect this may be because VSCode recognizes it as CSV and not plain text, then the extension rejects it because CSV is not supported. If you change the extension to .txt and reopen the document, do the tags work then?
Because CSV has no comment syntax, the extension is not setup to allow that language and automatically rejects it. @aaron-bond perhaps a new setting, forcePlainText, that either is an array of extensions, or a glob/regex for file names that would be processed as plain text files. the other alternative would be to simply decree that this should be illegal, since the use case is extremely limited, and only applies in cases where VSCode misjudges language, or those such as this, where further processing will be done before usage
Because CSV has no comment syntax, the extension is not setup to allow that language and automatically rejects
@aaron-bond
Hey you are actually right, I just tested it again. it works for .txt files but not for csv. So I will just second a request for force-plain-text. I really need this plug in to be VSCode wide. Its like "In line" Markdown. Its brilliant!