Description
Some time ago, I was working on #59724 and noticed something weird about extension
s and typedef
s not triggering comments suggestions. Today I found out what was actually wrong.
Although https://dart-review.googlesource.com/c/sdk/+/411380 makes some suggestions show up, it doesn't work well with PrefixedIdentifier
s. The problem is that even though both are AnnotatedNode
s, they never add the corresponding Comment
on the childEntries
.
See:
Variable:

Typedef:

This makes some completions work weirdly, see on classes:
On typedefs:
This is a problem because at DartCompletionManager.computeCandidateSuggestions
we call CompilationUnitImpl.select
, which uses AstNodeExtension.nodeCovering
internally for identifying the node.
We should probably think of a smart test to guarantee that any new AnnotatedNode
also contains Comment
on the childEntries
.
CC @bwilkerson