Closed
Description
The recommended way to document a getter/setter-pair property is to put DartDoc on the getter only. The DartDoc tool then documents similarly to a field.
The analysis server does not provide the getter DartDoc when hovering over a setter. This can be seen in, e.g., VSCode.
Take code like:
main() {
var c = C();
c.foo = null; // Shows setter-docs when hovering foo.
c.bar = null; // No docs when hovering bar.
}
class C {
/// Getter docs.
int get foo => 42;
/// Setter docs.
void set foo(int x) {}
/// Getter docs;
int get bar => 42;
void set bar(int x) {}
}
It should definitely show the getter docs for bar
.
Whether to show the getter or setter docs for foo
is a design decision. The DartDoc tool ignores the setter docs.