mozilla / sphinx-js

Autodoc-style extraction into Sphinx for your JS project
https://pypi.python.org/pypi/sphinx-js/
MIT License
282 stars 81 forks source link

Typescript: generic <A extends B> fails #119

Closed graup closed 4 years ago

graup commented 5 years ago

Culprit line: https://github.com/mozilla/sphinx-js/blob/2158457eeeafc0baa7aa86033dbe3d9e314223f6/sphinx_js/typedoc.py#L152

self.make_type_name(arg) for this case returns ['A', 'extends', ['B']] which cannot be joined. This line probably needs recursion.

graup commented 5 years ago

I fixed it in my fork: https://github.com/graup/sphinx-js/commit/4def189dc364f9c5a24331ae4dc7a4181abb75d5. Would need to add proper tests to merge it back here.

This whole tree parsing is kind of ugly. If we switch to a different internal representation, I'd rewrite the whole thing.

erikrose commented 4 years ago

This is fixed in the great IR merge of #120, demonstrated by https://github.com/mozilla/sphinx-js/blob/705659ceb08de1ec1fd16bdefd53e7b2e0a8d848/tests/test_typedoc_analysis/test_typedoc_analysis.py#L375-L379. Thanks!