Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Can't generate dartdoc for v0.9.0-alpha+2 due to analysis errors #207

Closed
chalin opened this issue Jan 9, 2018 · 10 comments
Closed

Can't generate dartdoc for v0.9.0-alpha+2 due to analysis errors #207

chalin opened this issue Jan 9, 2018 · 10 comments

Comments

@chalin
Copy link
Contributor

chalin commented Jan 9, 2018

Here is the log output.

acx > pub global run dartdoc --output doc/api
Generating documentation for 'angular_components' into /Users/chalin/git/dart/angular_components/doc/api/
parsing lib/angular_components.dart...
...
parsing lib/utils/rate_limit_utils/rate_limit_utils.dart...
parsing lib/utils/strings/string_utils.dart...
parsing /opt/homebrew/Cellar/dart/2.0.0-dev.15.0/libexec/lib/_internal/js_runtime/lib/interceptors.dart...
analysis errors from source: package:angular_components/mixins/highlight_assistant_mixin.dart (/Users/chalin/git/dart/angular_components/lib/mixins/highlight_assistant_mixin.dart
[error] Target of URI hasn't been generated: 'package:angular_components/highlighted_text/highlighted_value.template.dart'. at lib/mixins/highlight_assistant_mixin.dart, line 7.

Generation failed: encountered 1 analysis error.

But the analysis_options.yaml file contains:

analyzer:
  strong-mode: true
  errors:
    ...
    uri_has_not_been_generated: ignore

I'm using:

  • SDK 2.0.0-dev.15.0
  • Dartdoc 0.15.0+1

cc @kwalrath @jcollins-g

@chalin chalin mentioned this issue Jan 9, 2018
@nshahan
Copy link
Contributor

nshahan commented Jan 9, 2018

We are facing a similar problem with the pana package that analyzes and scores the packages for pub.dartlang.org. dart-lang/pana#213

Maybe there is a common solution we can agree on in both cases.

@alorenzen
Copy link
Contributor

This should be fixed by the switch to build_runner. I believe analyzer will eventually know how to work with those generated files, just like it does internally.

The problem is that with transformers, those files don't actually exist anywhere that the analyzer can use.

@nshahan
Copy link
Contributor

nshahan commented Jan 9, 2018

@chalin As a temporary workaround you can insert the line // ignore: uri_has_not_been_generated in lib/mixins/highlight_assistant_mixin.dart above the import of the template.dart file.

Then you can successfully run Dartdoc locally.

@chalin
Copy link
Contributor Author

chalin commented Jan 10, 2018

Good idea, I'll do that. Thanks.

@jcollins-g
Copy link

dart-lang/dartdoc#1586 is related to this as we don't interpret analysis options because we're not on the analysis driver yet. This is the next big piece of dartdoc work though.

@kevmoo
Copy link
Member

kevmoo commented Jan 19, 2018

Could we find a way to (optionally) ignore this error? dart-lang/dartdoc#1595

By just commenting out the throw in DartDoc, I was able to generate the docs for components pretty easily

@chalin
Copy link
Contributor Author

chalin commented Jan 19, 2018

@nshahan - FYI, adding // ignore_for_file: uri_has_not_been_generated to lib/mixins/highlight_assistant_mixin.dart doesn't help. Dartdoc still reports an error.

@jcollins-g
Copy link

jcollins-g commented Jan 19, 2018

If the docs generated are reasonable without the error dartdoc can be made to ignore it. This probably requires inspection; dartdoc itself might not be able to tell that it went off the rails, especially outside of checked mode. If the docs are still good despite the error we can add that to the list of things dartdoc sets for the analyzer, at least until our related bug about using the analysis driver is fixed.

@chalin
Copy link
Contributor Author

chalin commented Jan 20, 2018

My guess is that the resulting docs should be ok. I'm willing to do the required manual inspection if you'd like to put ignoring that error behind a flag.

@chalin
Copy link
Contributor Author

chalin commented Feb 14, 2018

If the docs generated are reasonable without the error dartdoc can be made to ignore it.

Doc generation seems to proceed now (under SDK 2-dev.24) even when the error is present. The generated docs seem fine.

@chalin chalin closed this as completed Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants