-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fixes for typedoc ~0.22.11 and strange self-referencing variable issue #189
base: master
Are you sure you want to change the base?
Fixes for typedoc ~0.22.11 and strange self-referencing variable issue #189
Conversation
sphinx_js/typedoc.py
Outdated
def rec_helper(node): | ||
if "sources" in node["__parent"]: | ||
return node["__parent"]["sources"] | ||
else: | ||
rec_helper(node["__parent"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it is styling, but how about
def rec_helper(node): | |
if "sources" in node["__parent"]: | |
return node["__parent"]["sources"] | |
else: | |
rec_helper(node["__parent"]) | |
def rec_helper(node): | |
if "sources" not in node["__parent"]: | |
rec_helper(node["__parent"]) | |
return node["__parent"]["sources"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Come to think of it, there's an apparent bug in this code to start with. The recursive handling isn't returning at all-- this is getting ignored.
I pulled this from someone else's work. I'll modify it and see if anything changes.
Add ability to recognize literals as a type for TypeScript.
8ae0efd
to
ebf7597
Compare
Change the recursive function call to a while loop. Co-authored-by: Tavian Barnes <[email protected]>
sphinx_js/typedoc.py
Outdated
@@ -328,6 +340,8 @@ def typedoc_output(abs_source_paths, sphinx_conf_dir, config_path): | |||
with NamedTemporaryFile(mode='w+b') as temp: | |||
command.add('--json', temp.name, *abs_source_paths) | |||
try: | |||
from pprint import pprint | |||
pprint(command.make()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover debugging code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Removed.
Co-authored-by: Tavian Barnes <[email protected]>
This Pull request includes a fix from @semohr to resolve #166 and also resolves an issue that came up in this merge request where a node of type 'reference' did not exist in the index, but did have a 'name' key. This seems to be something that's cropped up in the new version of TypeDoc.
I've also added one additional change-- the ability to recognize literals as types for TypeDoc, so that things like null and 'name' or what have you don't show up as '<TODO: Other Type>'