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

"No JSDoc documentation was found for object ClassName#methodName" #147

Closed
raucao opened this issue Jul 7, 2020 · 10 comments
Closed

"No JSDoc documentation was found for object ClassName#methodName" #147

raucao opened this issue Jul 7, 2020 · 10 comments

Comments

@raucao
Copy link

raucao commented Jul 7, 2020

We're in the process of porting a library with existing sphinx-js docs to TypeScript, and I ran into this issue when it came to the docs. When trying to build the docs with TypeDoc, I get the following error (class and method names being actual ones, of course):

No JSDoc documentation was found for object ClassName#methodName` or any path ending with that.

I don't know how Sphinx works in detail, but there seems to be some kind of global cache somewhere, because when I switch back to the master branch, it fails with the same error message with actual JSDoc (not TypeDoc), too. And even when I delete the entire folder and run it on a fresh clone, the error still persists.

I tried debugging it, but I couldn't find out how to be honest. Anyone has pointers that could help us find out what's going on?

erikrose added a commit to erikrose/sphinx-js that referenced this issue Jul 14, 2020
…harness. See mozilla#147.

The underlying bug where the TS analyzer cares what the cwd is remains.
@raucao
Copy link
Author

raucao commented Jul 22, 2020

Having seen that this issue was ref'd in a commit that was part of the release for Sphinx 3 compat, I just upgraded to sphinx-js 3.0 and tried again. However, now I'm seeing a different bug, which also prevents building the docs. Maybe someone knows where this could come from:

| Running Sphinx v3.1.1                                                              
|                                                                                    
| Using TypeScript 3.9.5 from /home/basti/.nvm/versions/node/v12.16.3/lib/node_modules/typescript/lib
|                                                                                    
| JSON written to /tmp/tmp_sayv04w                                                   
|                                                                                    
                                                                                     
Extension error:                                                                     
Handler <function gather_doclets at 0x7f0d9d2519d0> for event 'builder-inited' threw an exception

@erikrose
Copy link
Contributor

Can you pass -v to sphinx-build? That should give you a traceback I can work with. Thanks!

@raucao
Copy link
Author

raucao commented Jul 29, 2020

Somehow missed your reply a week ago.

I tried again with -v and it turned out the first exception was #143 again. After applying the fix, I was back at the original issue (which may also be caused by #143 and/or the fix I used). Here's the full stacktrace for that:

Traceback (most recent call last):
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx_js/suffix_tree.py", line 39, in get_with_path
    tree = tree[seg]
KeyError: 'getListing'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx_js/renderers.py", line 68, in rst_nodes
    doclet, full_path = self._app._sphinxjs_doclets_by_path.get_with_path(self._partial_path)
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx_js/suffix_tree.py", line 42, in get_with_path
    raise SuffixNotFound(segments)
sphinx_js.suffix_tree.SuffixNotFound: No path found ending in BaseClient#getListing.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/application.py", line 348, in build
    self.builder.build_update()
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 297, in build_update
    self.build(to_build,
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 311, in build
    updated_docnames = set(self.read())
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 418, in read
    self._read_serial(docnames)
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 439, in _read_serial
    self.read_doc(docname)
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 479, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/io.py", line 221, in read_doc
    pub.publish()
  File "/usr/lib/python3.8/site-packages/docutils/core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/io.py", line 126, in read
    self.parse()
  File "/usr/lib/python3.8/site-packages/docutils/readers/__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/parsers.py", line 102, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2096, in directive
    return self.run_directive(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx/domains/__init__.py", line 285, in run
    return super().run()
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx_js/directives.py", line 38, in run
    return AutoFunctionRenderer.from_directive(self, app).rst_nodes()
  File "/home/basti/.local/lib/python3.8/site-packages/sphinx_js/renderers.py", line 70, in rst_nodes
    raise SphinxError('No JSDoc documentation was found for object "%s" or any path ending with that.'
sphinx.errors.SphinxError: No JSDoc documentation was found for object "BaseClient#getListing" or any path ending with that.

@raucao
Copy link
Author

raucao commented Jul 29, 2020

If it helps: you can also try this yourself with our current branch.

git clone [email protected]:remotestorage/remotestorage.js.git && \
cd remotestorage.js && \
npm install && \
npm run build:docs

@erikrose
Copy link
Contributor

Thanks!

@raucao
Copy link
Author

raucao commented Aug 4, 2020

Just a heads-up: we merged that pull request, so you can test this in our master branch now. I have adjusted the above bash script accordingly.

@erikrose
Copy link
Contributor

Great; I appreciate it. I'm currently rewriting the TS support in its entirety, so we'll see if this persists after that.

@raucao
Copy link
Author

raucao commented Sep 22, 2020

Finally had some time to test-run 3.1 against our code, and this issue has been solved now. Thanks a lot for all your work!

@raucao raucao closed this as completed Sep 22, 2020
@erikrose
Copy link
Contributor

erikrose commented Sep 22, 2020

Oh good! 3.1 does require at least Python 3.7. I hope that isn't a problem for moz-central atm?

@erikrose
Copy link
Contributor

Sorry, I was thinking of the wrong issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants