Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression: docgen drops enum doc comments #15702

Closed
ghost opened this issue Oct 24, 2020 · 2 comments
Closed

regression: docgen drops enum doc comments #15702

ghost opened this issue Oct 24, 2020 · 2 comments
Assignees
Labels
Documentation Generation Related to documentation generation (but not content). Regression

Comments

@ghost
Copy link

ghost commented Oct 24, 2020

Check out http://nim-lang.github.io/Nim/io.html:
image

On 1.2.8
image

@ghost ghost added Regression Documentation Generation Related to documentation generation (but not content). labels Oct 24, 2020
@Jjp137
Copy link
Contributor

Jjp137 commented Oct 24, 2020

From what I can tell, it seems that the comments disappear if the item involved is an enum (although there may be other cases).

Here's a test file:

type Point* = object
  ## A coord pair.
  x*: int  ## The x coord
  y*: int  ## The y coord

type Shapes* = enum
  ## Some shapes.
  Circle,     ## A circle
  Triangle,   ## A three-sided shape
  Rectangle   ## A four-sided shape

proc example*() =
  ## An example proc.
  runnableExamples:
    discard 1 + 1     ## Some math
    discard "hello!"  ## A string
  discard

Upon running nim doc on 1.4.0, the aligned comments for the Shapes enum are not kept in the HTML output.

@timotheecour
Copy link
Member

timotheecour commented Oct 24, 2020

git bisect finds this:

5db0bb744c08feb0c2c17ecd9cba12c276cde374 is the first bad commit
commit 5db0bb744c08feb0c2c17ecd9cba12c276cde374
Author: cooldome <cdome@bk.ru>
Date:   Tue Apr 21 19:12:32 2020 +0100

    Replace enum fields idents with syms (#14048)

    * replace enum fields idents with syms
    * Trigger build

    Co-authored-by: cooldome <ariabushenko@bk.ru>

 changelog.md          |  4 ++++
 compiler/semtypes.nim | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
bisect run success

so nimdoc logic needs to be updated after #14048 /cc @cooldome

note

for future reference, here's my git bisect command to find this:

git bisect start v1.4.0 v1.2.0 

git bisect run zsh -c "source ~/.zshrc && nim=$nim_csources_local_X d_nim_build_simple_local --skipusercfg --hints:off -o:bin/nim.bisect && bin/nim.bisect doc -o:/tmp/z01.html $timn_D/tests/nim/all/t11183.nim && grep D20201024T143000 /tmp/z01.html"

(adapt as needed)

@timotheecour timotheecour changed the title docgen doesn't keep aligned comments anymore (?) regression: docgen drops enum doc comments Oct 24, 2020
narimiran added a commit to narimiran/Nim that referenced this issue Oct 30, 2020
@Araq Araq closed this as completed in 28bbcd9 Oct 30, 2020
narimiran added a commit that referenced this issue Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Generation Related to documentation generation (but not content). Regression
Projects
None yet
Development

No branches or pull requests

3 participants