Skip to content

Commit 9e2d9ec

Browse files
pqcommit-bot@chromium.org
authored andcommitted
tests for missing getter/setter available suggestions
See: #40626 Change-Id: I3e35b5d7bf849c1afd20b5bd512b7e8b201e2200 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135783 Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 63c8bb7 commit 9e2d9ec

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

pkg/analysis_server/test/client/completion_driver_test.dart

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,25 @@ void main() {
367367
completion: 'v',
368368
element: ElementKind.TOP_LEVEL_VARIABLE,
369369
kind: CompletionSuggestionKind.INVOCATION);
370+
}
371+
372+
/// See: https://github.com/dart-lang/sdk/issues/40626
373+
@failingTest
374+
Future<void> test_project_lib_getters() async {
375+
await addProjectFile('lib/a.dart', r'''
376+
int get g => 0;
377+
''');
378+
379+
await addTestFile('''
380+
void main() {
381+
^
382+
}
383+
''');
370384

371-
// todo (pq): getters/setters?
385+
expectSuggestion(
386+
completion: 's',
387+
element: ElementKind.SETTER,
388+
kind: CompletionSuggestionKind.INVOCATION);
372389
}
373390

374391
@failingTest
@@ -394,6 +411,25 @@ void main() {
394411
kind: CompletionSuggestionKind.INVOCATION);
395412
}
396413

414+
/// See: https://github.com/dart-lang/sdk/issues/40626
415+
@failingTest
416+
Future<void> test_project_lib_setters() async {
417+
await addProjectFile('lib/a.dart', r'''
418+
set s(int s) {}
419+
''');
420+
421+
await addTestFile('''
422+
void main() {
423+
^
424+
}
425+
''');
426+
427+
expectSuggestion(
428+
completion: 's',
429+
element: ElementKind.SETTER,
430+
kind: CompletionSuggestionKind.INVOCATION);
431+
}
432+
397433
Future<void> test_sdk_lib_future_isNotDuplicated() async {
398434
await addTestFile('''
399435
void main() {

0 commit comments

Comments
 (0)