I'm not super confident in this fix, but it passes existing tests, so maybe it's fine :P
The problem here happens when specifying TypeScript source files directly in js_source_paths instead of a folder. The added test is a copy of the existing test_build_ts, but in conf.py I specify js_source_path = '../class.ts'. This is enough to trigger the problem.
The resulting doclets confuse the path parsing logic. Here's an example doclet and error from the project I was working on when I ran into this:
I'm not super confident in this fix, but it passes existing tests, so maybe it's fine :P
The problem here happens when specifying TypeScript source files directly in
js_source_paths
instead of a folder. The added test is a copy of the existingtest_build_ts
, but inconf.py
I specifyjs_source_path = '../class.ts'
. This is enough to trigger the problem.The resulting doclets confuse the path parsing logic. Here's an example doclet and error from the project I was working on when I ran into this:
{'kind': 'module', 'comment': '<empty>', 'meta': {'path': './', 'filename': 'index.ts', 'lineno': 1, 'code': {}}, 'name': '"index"', 'longname': 'module:index', 'description': ''}
And error (modified to show larger context):