Markdowns as comments

At present the comments look and work ok but I wish we could write comments as markdown so it gets highlighted and formatted so they are more readable both in editor and online such as github.

Doc comments are already written in markdown. As for non-doc comments you can use whatever format you want. If you want highlighting you could implement it yourself in your editor. As for github, they don't highlight doc comments either.

If you want highlighting you could implement it yourself in your editor. As for github, they don't highlight doc comments either.

Am suggesting this to be a standard as part of rust spec so VSCode, github and diff tools can inline highlight the comments out of the box (as a standard or as an extension); so we as a developer can gain productivity.

I think seeing markdown based comments will help comments more readable, these comments will pop out, highlight and make it easy to read as compared to now

Tools can already do this. It doesn't have to be formally "part" of Rust. The reason doc comments are specified to be markdown is because that's what rustdoc — an integral part of Rust — expects.

1 Like

And vscode and github doesn't highlight doc comments either despite those being specified as markdown, so it is unlikely they will highlight regular comments with your proposal. (if you see highlighting of doc comments in vscode, that is coming from rust-analyzer, not vscode itself)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.