Bug 4520 – add support for //! style documentation comments

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-07-27T10:28:00Z
Last change time
2015-06-09T05:10:40Z
Keywords
ddoc, patch
Assigned to
nobody
Creator
hoganmeier

Attachments

IDFilenameSummaryContent-TypeSize
699bug4520.patchpatch for the lexertext/plain1544

Comments

Comment #0 by hoganmeier — 2010-07-27T10:28:43Z
Created attachment 699 patch for the lexer I added //! style documentation comments to my dmd and thought I'd share that. Since it only requires minimal changes to the lexer and doesn't add any complexity to the compiler it could be integrated into dmd. Note: Doxygen supports these comments.
Comment #1 by bearophile_hugs — 2010-07-27T11:08:37Z
What's the advantage of using //! instead of the /// style that is already supported?
Comment #2 by hoganmeier — 2010-07-27T11:13:46Z
Well it's personal taste. As I said, only requires minimal changes to the lexer, Doxygen also uses /// and //!, so why not? It's just a proposal.
Comment #3 by leandro.lucarella — 2010-07-27T13:59:21Z
The fact that is used often in Doxygen might be a factor to include this patch, since it will make life easier for people used to use Doxygen. Is not a very strong argument for including it, though :)
Comment #4 by issues.dlang — 2010-07-27T14:54:00Z
Except that /// and /** */ are already supported in D and used by doxygen. So, if you're looking for doxygen support, we already have it. It's true that //! is another way to do comments that doxygen supports, but it's not necessary. Also, what exactly is this patch supposed to do? Does it make it so that //! are treated like ddoc comments? Because //! is already a perfectly legitimate comment because it starts with //, and doxygen will read it exactly the same way it reads ///. If it is the case that it's ddoc comments that you're looking for, I'd argue that you should actually use /++ +/ rather than a doxygen style since doxygen comments are done differently than ddoc comments anyway (doxygen favoring tags and ddoc comments being freeform). Regardless, I don't care one way or another whether this patch gets included. I just don't see the point.
Comment #5 by hoganmeier — 2010-07-27T15:14:14Z
The patch makes //! treated as a ddoc comment. As I already said, it's just a matter of taste. I prefer //! so I patched my dmd to be free to choose. I didn't claim this was necessary in any way (which is why this is marked as ENHANCEMENT). It's a tiny 3-line patch that doesn't hurt so I added it here.
Comment #6 by dfj1esp02 — 2010-07-28T11:24:39Z
I'm afraid, it's useless. Doxygen uses its own markup and macros, they will be treated as plain text in ddoc comments. It's useless.
Comment #7 by yao.gomez — 2012-02-05T14:31:20Z
There was recently a pull request to add this type of doc comments to DMD (I think that it was Trass3r too the one doing it) and it was rejected and closed by Walter & Co. So I think that it's pretty safe to assume that this definitely will not be accepted. So with this in mind I'm closing this bug report. However, if you want to give the good fight and make another attempt, please reopen and add your comments.