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

Change document-exported to traverse the code #533

Merged
merged 3 commits into from
Sep 9, 2016

Conversation

arv
Copy link
Contributor

@arv arv commented Sep 8, 2016

Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes #515

Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes documentationjs#515

/**
* Iterate through the abstract syntax tree, finding ES6-style exports,
* and inserting blank comments into documentation.js's processing stream.
* Through inference steps, these comments gain more information and are automatically
* documented as well as we can.
* @param {Function} parseToAst funtiont that parses to an ast
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functiont -> function

@arv
Copy link
Contributor Author

arv commented Sep 8, 2016

One thing I "struggled" with in this PR is to propagate the filename and source. Babel can attach the filename to the location of all location objects. That way we do not need to pass in data... but we do need the source of the filename so that would require a cache (or pass that in again). Also the data contains the sortKey. I can probably get rid of the sortKey and compare using filename + location instead.

@tmcw
Copy link
Member

tmcw commented Sep 9, 2016

Wow, okay - yeah, took me a little while to even figure out what this patch is doing. Very impressive.

Merging - I've been doing mostly work and not much documentation.js recently, but have some free time in the next few days so am looking to knock out a lot of outstanding tasks.

@tmcw tmcw merged commit e11c1ab into documentationjs:master Sep 9, 2016
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

Successfully merging this pull request may close these issues.

2 participants