Skip to content

[vm/ffi] Remove documentation from setters #38892

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
dcharkes opened this issue Oct 15, 2019 · 0 comments
Closed

[vm/ffi] Remove documentation from setters #38892

dcharkes opened this issue Oct 15, 2019 · 0 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-ffi

Comments

@dcharkes
Copy link
Contributor

dcharkes commented Oct 15, 2019

As pointed out by @lrhn

Avoid having a doc comment on both the setter and the getter, as DartDoc will show only one (the one on the getter.)

https://dart.dev/guides/language/effective-dart/documentation#prefer-starting-variable-getter-or-setter-comments-with-noun-phrases

However, the documentation of the getter does not show up when hovering the setter (at least not in VSCode).

For now, we create the dart:ffi documentation both for getter and setter, but we should remove the documentation on the setter once all IDEs properly support it.

main() {
  final zoo = Zoo();
  zoo.numAnimals = 3; // No documentation on numAnimals setter.
  print(zoo.numAnimals);
}

class Zoo {
  int _numAnimals;

  /// The [numAnimals] in the zoo.
  int get numAnimals => _numAnimals;
  void set numAnimals(int numAnimals) {
    _numAnimals = numAnimals;
  }
}

/cc @mkustermann @sjindel-google

@dcharkes dcharkes self-assigned this Oct 15, 2019
@a-siva a-siva added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label Oct 15, 2019
@dcharkes dcharkes removed their assignment Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-ffi
Projects
None yet
Development

No branches or pull requests

2 participants