Skip to content

Commit f83770e

Browse files
pqcommit-bot@chromium.org
authored andcommitted
add available suggestions for getters/setters
Fixes: #40626 Change-Id: I765928864c719a4c7202f9bdc768c7a6e4d8e850 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135789 Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 3570508 commit f83770e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ class DartCompletionManager implements CompletionContributor {
241241
kinds.add(protocol.ElementKind.ENUM_CONSTANT);
242242
kinds.add(protocol.ElementKind.EXTENSION);
243243
kinds.add(protocol.ElementKind.FUNCTION);
244+
kinds.add(protocol.ElementKind.GETTER);
245+
kinds.add(protocol.ElementKind.SETTER);
244246
kinds.add(protocol.ElementKind.TOP_LEVEL_VARIABLE);
245247
}
246248
}

pkg/analysis_server/test/client/completion_driver_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ void main() {
370370
}
371371

372372
/// See: https://github.com/dart-lang/sdk/issues/40626
373-
@failingTest
374373
Future<void> test_project_lib_getters() async {
375374
await addProjectFile('lib/a.dart', r'''
376375
int get g => 0;
@@ -383,8 +382,8 @@ void main() {
383382
''');
384383

385384
expectSuggestion(
386-
completion: 's',
387-
element: ElementKind.SETTER,
385+
completion: 'g',
386+
element: ElementKind.GETTER,
388387
kind: CompletionSuggestionKind.INVOCATION);
389388
}
390389

@@ -412,7 +411,6 @@ void main() {
412411
}
413412

414413
/// See: https://github.com/dart-lang/sdk/issues/40626
415-
@failingTest
416414
Future<void> test_project_lib_setters() async {
417415
await addProjectFile('lib/a.dart', r'''
418416
set s(int s) {}

pkg/analysis_server/test/src/domains/completion/get_suggestions_available_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ main() {
184184
ElementKind.EXTENSION,
185185
ElementKind.FUNCTION,
186186
ElementKind.FUNCTION_TYPE_ALIAS,
187+
ElementKind.GETTER,
187188
ElementKind.MIXIN,
189+
ElementKind.SETTER,
188190
ElementKind.TOP_LEVEL_VARIABLE,
189191
]),
190192
);

0 commit comments

Comments
 (0)