Skip to content

Analysis server does not provide getter dartdoc when hovering over setter. #38963

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

Closed
lrhn opened this issue Oct 18, 2019 · 2 comments
Closed
Labels
devexp-server Issues related to some aspect of the analysis server legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Oct 18, 2019

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.

See #38892 (and perhaps #2798)

@lrhn lrhn added legacy-area-analyzer Use area-devexp instead. devexp-server Issues related to some aspect of the analysis server type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 18, 2019
@dcharkes
Copy link
Contributor

/cc myself, so that I can update dart:ffi documentation when this is fixed.

@parlough
Copy link
Member

I went ahead and addressed this here: https://dart-review.googlesource.com/c/sdk/+/148566

If you'd like, I'd appreciate feedback in how to prioritize the docs. I've outlined what order I currently set it up as in the CL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-server Issues related to some aspect of the analysis server legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants