[analysis_server] Don't show return type Inlay Hints on setters

Change-Id: I3f1d63cf0d71c1028ee3cbf3b780edcefb561aac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259588
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analysis_server/lib/src/computer/computer_inlay_hint.dart b/pkg/analysis_server/lib/src/computer/computer_inlay_hint.dart
index bdbbed5..4c13095 100644
--- a/pkg/analysis_server/lib/src/computer/computer_inlay_hint.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_inlay_hint.dart
@@ -96,6 +96,11 @@
       return;
     }
 
+    // Don't add "void" for setters.
+    if (node.isSetter) {
+      return;
+    }
+
     final declaration = node.declaredElement2;
     if (declaration != null) {
       // For getters/setters, the type must come before the property keyword,
diff --git a/pkg/analysis_server/test/lsp/inlay_hint_test.dart b/pkg/analysis_server/test/lsp/inlay_hint_test.dart
index 641f95e..634ca9a 100644
--- a/pkg/analysis_server/test/lsp/inlay_hint_test.dart
+++ b/pkg/analysis_server/test/lsp/inlay_hint_test.dart
@@ -250,8 +250,9 @@
     final content = '''
 set f(int i) {}
 ''';
+    // Setters are always `void` so we don't show a label there.
     final expected = '''
-(Type:void) set f(int i) {}
+set f(int i) {}
 ''';
     await _testHints(content, expected);
   }