add available suggestions for getters/setters

Fixes: https://github.com/dart-lang/sdk/issues/40626

Change-Id: I765928864c719a4c7202f9bdc768c7a6e4d8e850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135789
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
pq 2020-02-14 17:42:39 +00:00 committed by commit-bot@chromium.org
parent 35705086c5
commit f83770e1fe
3 changed files with 6 additions and 4 deletions

View file

@ -241,6 +241,8 @@ class DartCompletionManager implements CompletionContributor {
kinds.add(protocol.ElementKind.ENUM_CONSTANT);
kinds.add(protocol.ElementKind.EXTENSION);
kinds.add(protocol.ElementKind.FUNCTION);
kinds.add(protocol.ElementKind.GETTER);
kinds.add(protocol.ElementKind.SETTER);
kinds.add(protocol.ElementKind.TOP_LEVEL_VARIABLE);
}
}

View file

@ -370,7 +370,6 @@ void main() {
}
/// See: https://github.com/dart-lang/sdk/issues/40626
@failingTest
Future<void> test_project_lib_getters() async {
await addProjectFile('lib/a.dart', r'''
int get g => 0;
@ -383,8 +382,8 @@ void main() {
''');
expectSuggestion(
completion: 's',
element: ElementKind.SETTER,
completion: 'g',
element: ElementKind.GETTER,
kind: CompletionSuggestionKind.INVOCATION);
}
@ -412,7 +411,6 @@ void main() {
}
/// See: https://github.com/dart-lang/sdk/issues/40626
@failingTest
Future<void> test_project_lib_setters() async {
await addProjectFile('lib/a.dart', r'''
set s(int s) {}

View file

@ -184,7 +184,9 @@ main() {
ElementKind.EXTENSION,
ElementKind.FUNCTION,
ElementKind.FUNCTION_TYPE_ALIAS,
ElementKind.GETTER,
ElementKind.MIXIN,
ElementKind.SETTER,
ElementKind.TOP_LEVEL_VARIABLE,
]),
);