-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix(cli): fix stack overflow in Deno doc when namespace exports itself #599
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -580,6 +580,10 @@ impl<'a> DocParser<'a> { | |
let mut handled_symbols = HashSet::new(); | ||
|
||
for (export_name, export_symbol_id) in symbol.exports() { | ||
if export_name == &namespace_name | ||
{ | ||
continue; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens for the following code? export declare namespace test {
const test: string;
export { test };
} Or the following: export declare namespace test {
export class test {}
} I think it can't be based on strings, but probably needs to be based on the symbol id or swc id. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I previously attempted to use the symbol ID, but the output varied for certain inputs. For instance:
The documentation is only generated for the first line: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @dsherret |
||
handled_symbols.insert(UniqueSymbolId::new( | ||
module_info.module_id(), | ||
*export_symbol_id, | ||
|
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.
We should add a test for this in tests/specs (copy and paste another .txt file, modify it, then run
cargo test
to see if it works. You can useUPDATE=1
env var to update the expected output with the actual output)