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

Dartdoc needs to be migrated to the new analysis driver #1586

Closed
stereotype441 opened this issue Jan 5, 2018 · 5 comments
Closed

Dartdoc needs to be migrated to the new analysis driver #1586

stereotype441 opened this issue Jan 5, 2018 · 5 comments
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@stereotype441
Copy link
Member

The Dart 2.0 features mentioned in dart-lang/sdk#31640 are going to be implemented using the new analysis driver; they aren't guaranteed to be backported to the old analyzer task model. So in order to ensure that Dartdoc is Dart 2.0 compliant we will need to change Dartdoc to make use of the new analysis driver.

We will probably need assistance from @bwilkerson and @scheglov to determine the proper analyzer entry points for Dartdoc to use.

@stereotype441 stereotype441 added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Jan 5, 2018
@devoncarew
Copy link
Member

also cc'ing @pq, as he has done the migration for the linter, so could provide pointers / links to PRs.

@jcollins-g
Copy link
Contributor

jcollins-g commented Jan 5, 2018

Situation is better for dartdoc nowadays -- there's only one point at which we grab AnalysisContexts from the analyzer, which is here:

return AnalysisEngine.instance.createAnalysisContext()

We can move dartdoc by porting over this small section to whatever can give us analyzer data.

@pq
Copy link
Member

pq commented Jan 5, 2018

Cool!

FWIW, here's the relevant PR for the linter migration: dart-lang/linter#754.

Happy to walk you through it whenever.

@jcollins-g
Copy link
Contributor

This will also enable interpretation of analysis options files.

@jcollins-g
Copy link
Contributor

I started on this yesterday and got dartdoc mostly functioning in the way that it does now (a PR to come soon).

However, it turns out that we can't quite get analysis options file interpretation going as quickly. The architecture of the analyzer requires there to be one AnalysisDriver (or in the old model, AnalysisContext) for every analysis options file. Neither dartdoc nor the command line linter (@pq) operate in this manner currently -- they simply use a single context/driver for all files to be analyzed. I had misinterpreted "converting to AnalysisDriver" as being equivalent to converting to something that can manage all that for you.

Talked with @bwilkerson and creating something that creates AnalysisDrivers for you, manages them, and dispatches addFile() to the right driver is likely beyond the context of dartdoc and should be shared code in the analyzer.

This means that for #1595 we'll need to hack around the errors yet again until we can get the proper API from the analyzer (or, alternatively, give up and implement it ourselves within dartdoc). In the meantime, this issue will be redefined as simply get us out of using the AnalysisContext objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants