Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart

Issue 2681233005: Analysis.getHover should return the field's documentation for field formal parameters. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/analysis/get_hover_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
index d534e1dab3f8e806ccd5eb69d4aafe65a12cabee..3ac9fd84a7fcaa58c197af55dbe48b88be1a2d36 100644
--- a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
@@ -482,37 +482,57 @@ class A { const A(int one, int two, int three, {int four, String five:
}
test_ArgumentList_local_constructor_named_fieldFormal_documentation() async {
- addTestSource('''
+ String content = '''
class A {
/// aaa
///
/// bbb
/// ccc
int fff;
-A({this.fff}) { } }
+ A({this.fff});
+}
main() {
new A(^);
}
-''');
+''';
+ addTestSource(content);
await computeSuggestions();
expect(suggestions, hasLength(1));
- expect(suggestions[0].docSummary, 'aaa');
- expect(suggestions[0].docComplete, 'aaa\n\nbbb\nccc');
+
+ CompletionSuggestion suggestion = suggestions[0];
+ expect(suggestion.docSummary, 'aaa');
+ expect(suggestion.docComplete, 'aaa\n\nbbb\nccc');
+
+ Element element = suggestion.element;
+ expect(element, isNotNull);
+ expect(element.kind, ElementKind.PARAMETER);
+ expect(element.name, 'fff');
+ expect(element.location.offset, content.indexOf('fff})'));
}
test_ArgumentList_local_constructor_named_fieldFormal_noDocumentation() async {
- addTestSource('''
+ String content = '''
class A {
int fff;
-A({this.fff}) { } }
+ A({this.fff});
+}
main() {
new A(^);
}
-''');
+''';
+ addTestSource(content);
await computeSuggestions();
expect(suggestions, hasLength(1));
- expect(suggestions[0].docSummary, isNull);
- expect(suggestions[0].docComplete, isNull);
+
+ CompletionSuggestion suggestion = suggestions[0];
+ expect(suggestion.docSummary, isNull);
+ expect(suggestion.docComplete, isNull);
+
+ Element element = suggestion.element;
+ expect(element, isNotNull);
+ expect(element.kind, ElementKind.PARAMETER);
+ expect(element.name, 'fff');
+ expect(element.location.offset, content.indexOf('fff})'));
}
test_ArgumentList_local_constructor_named_param() async {
« no previous file with comments | « pkg/analysis_server/test/analysis/get_hover_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698