Bug 9475 – Should retain source formatting in ddoc's unittests

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-07T16:11:00Z
Last change time
2013-03-14T11:34:50Z
Keywords
ddoc, pull
Assigned to
andrej.mitrovich
Creator
hsteoh

Comments

Comment #0 by hsteoh — 2013-02-07T16:11:02Z
Code: ------------------------------- /** * Main program */ void main() { } /// Example unittest { foreach (i; 0 .. 10) { documentedFunction(); } } ----------------------------------- Output: ------------------------------- <br><br> <dl><dt><big><a name="main"></a>void <u>main</u>(); </big></dt> <dd>Main program<br><br> <b>Example:</b><pre class="d_code"><font color=blue>foreach</font> (i; 0 .. 10) { documentedFunction(); } </pre><br><br> </dd> </dl> ------------------------------- Notice that the indentation of the loop body has been lost. This makes example code have bad indentation in the generated docs.
Comment #1 by andrej.mitrovich — 2013-02-08T06:42:54Z
*** Issue 9472 has been marked as a duplicate of this issue. ***
Comment #2 by andrej.mitrovich — 2013-02-08T06:48:06Z
Comment #3 by github-bugzilla — 2013-03-14T01:04:03Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/96346c9e553252946bc3c7fc31cdf052672df252 Fixes Issue 9475 - Preserve code layout in unittest body when emitting ddoc. https://github.com/D-Programming-Language/dmd/commit/80ba0391eb227337366e193986a270f3538deb07 Merge pull request #1641 from AndrejMitrovic/Fix9475 Issue 9475 - Preserve code layout in unittest body when emitting ddoc.
Comment #4 by hsteoh — 2013-03-14T08:08:33Z
Hooray, seems to work now! Are there any missing cases (why did you say it was just a "partial fix")?
Comment #5 by andrej.mitrovich — 2013-03-14T10:01:32Z
(In reply to comment #4) > Hooray, seems to work now! > > Are there any missing cases (why did you say it was just a "partial fix")? It was because code was not indented properly, but this has since been fixed thanks to Kenji's indentation code which I've borrowed.
Comment #6 by hsteoh — 2013-03-14T11:34:50Z
Alright, then this bug is done. Closing.