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

nim jsondoc output is broken #20132

Closed
geotre opened this issue Aug 1, 2022 · 1 comment · Fixed by #20135
Closed

nim jsondoc output is broken #20132

geotre opened this issue Aug 1, 2022 · 1 comment · Fixed by #20135

Comments

@geotre
Copy link

geotre commented Aug 1, 2022

jsondoc command does not produce output on 1.6.* or devel. It works correctly on 1.4.8.

Example code.nim

proc doSomething*(x, y: int): int =
  x + y

const
  a* = 1
  b* = "test"

type
  MyEnum* = enum
    foo, bar

Current Output

{"orig":".../code.nim","nimble":"unknown","moduleDescription":"","entries":[]}

Expected Output

{"orig":".../code.nim","nimble":"","moduleDescription":"","entries":[{"name":"doSomething","type":"skProc","line":2,"col":0,"code":"proc doSomething(x, y: int): int {.raises: [], tags: [].}","signature":{"return":"int","arguments":[{"name":"x","type":"int"},{"name":"y","type":"int"}],"pragmas":["raises: []","tags: []"]}},{"name":"a","type":"skConst","line":6,"col":2,"code":"a = 1"},{"name":"b","type":"skConst","line":7,"col":2,"code":"b = \"test\""},{"name":"MyEnum","type":"skType","line":10,"col":10,"code":"MyEnum = enum\n  foo, bar"}]}
@ringabout
Copy link
Member

#18256 seems to cause the regression

Araq pushed a commit that referenced this issue Aug 4, 2022
* fixes #20132; fixes the broken jsondoc comand

* add testcase
narimiran pushed a commit that referenced this issue Aug 23, 2022
* fixes #20132; fixes the broken jsondoc comand

* add testcase

(cherry picked from commit 2aeb0d5)
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants