dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

[doc_imports] `[this]` won't resolve to the current element in new analyzer comment resolver

Open kallentu opened this issue 2 months ago • 3 comments

Background

Example of a [this] reference:

Resolution today

Dartdoc adds this as a reference child to look through. When it looks for a reference for the current ModelElement, it will find itself and create a link to that element.

Resolution tomorrow

AFAIK the comment reference resolver in the analyzer doesn’t handle a reference named this.

We need to make sure that we add this into the ModelNode data that we are building up in Dartdoc, or alter the analyzer reference resolver in some way (not sure about this one).

But make sure we handle this, otherwise there will be a regression once we move to solely use what the analyzer provides.

kallentu avatar Apr 29 '24 19:04 kallentu

Related linter issue: https://github.com/dart-lang/linter/issues/2079

kallentu avatar Apr 29 '24 22:04 kallentu

We think this is acceptable. I can remove support for [this] in dartdoc, so that the change is incremental, and we can analyze the ongoing gap between the current universal reference support, and analyzer resolution.

srawlins avatar Apr 30 '24 22:04 srawlins

That sounds good. There's other ways to reference the current element anyways.

kallentu avatar Apr 30 '24 22:04 kallentu