-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
comment_references lint doesn't support dartdoc's idea of "in scope" #57783
Comments
At the least it would be really nice if it considered |
Looking at where dartdoc does resolution: https://github.com/dart-lang/dartdoc/blob/master/lib/src/markdown_processor.dart it seems highly unlikely that we can replicate this fully in the linter. In particular: there are comments in a few places about things being expensive, and it seems like it might end up pulling in non-local information (i.e., how dartdoc is configured). "Resolve using the analyzer" is just one step of many :) I definitely want to find a way to make this lint work, but it seems likely that that includes accepting a cut-down version of dartdoc resolution. We might for example end up with a 'strict mode' for dartdoc that only uses the analyzer for resolution--then improve analyzer resolution until people are happy with it. Thoughts? This is all purely speculation on my part :) |
I probably agree but would love to hear from @jcollins-g. We'd also talked about using Another alternative would be to push this into analyzer proper, allowing clients to (conditionally) ask for doc resolution (or something) but I haven't thought too hard about the ramifications. (Maybe @bwilkerson and @scheglov can say something about that.) |
+1 to have homogeneous resolution of comment references. |
For context, the I too would like to see the analyzer's and dartdoc's resolution of doc comment references be the same and have been advocating for it for a long time. Janice and I have talked about it several times over the last couple of years. As I understand it, That said, we have been working for some time to reduce the amount of data that the analyzer caches in order to reduce the memory footprint of the analysis server. The model is large, and caching it would be counterproductive in terms of memory use. Perhaps there are other options that I'm not seeing. |
As of dart-lang/dartdoc#1153, dartdoc considers pretty much everything it knows about to be in scope regardless of whether it's in scope at the Dart level. Unfortunately, the comment_references lint doesn't follow the same convention. So, for example,
packages/flutter/lib/painting.dart
in flutter's repo ends up flagging the three terms in the library docs ([TextPainter]
,[Decoration]
, etc) even though those are valid. This makes the lint unusable for our purposes, even though it actually catches a bunch of errors so we would love to use it.The text was updated successfully, but these errors were encountered: