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

Unified Diff: pkg/analysis_server/test/analysis/get_hover_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
Index: pkg/analysis_server/test/analysis/get_hover_test.dart
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index 7f48ae2d97683c34745be9e39479de621943e540..66db6aaed1f9c3332cb9a97641de86fdbb393998 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -308,6 +308,48 @@ class A {
expect(hover.parameter, isNull);
}
+ test_expression_parameter_fieldFormal_declaration() async {
+ addTestFile('''
+class A {
+ /// The field documentation.
+ final int fff;
+ A({this.fff});
+}
+main() {
+ new A(fff: 42);
+}
+''');
+ HoverInformation hover = await prepareHover('fff});');
+ expect(hover.containingLibraryName, isNull);
+ expect(hover.containingLibraryPath, isNull);
+ expect(hover.containingClassDescription, isNull);
+ expect(hover.dartdoc, 'The field documentation.');
+ expect(hover.elementDescription, '{int fff}');
+ expect(hover.elementKind, 'parameter');
+ expect(hover.staticType, 'int');
+ }
+
+ test_expression_parameter_fieldFormal_use() async {
+ addTestFile('''
+class A {
+ /// The field documentation.
+ final int fff;
+ A({this.fff});
+}
+main() {
+ new A(fff: 42);
+}
+''');
+ HoverInformation hover = await prepareHover('fff: 42');
+ expect(hover.containingLibraryName, isNull);
+ expect(hover.containingLibraryPath, isNull);
+ expect(hover.containingClassDescription, isNull);
+ expect(hover.dartdoc, 'The field documentation.');
+ expect(hover.elementDescription, '{int fff}');
+ expect(hover.elementKind, 'parameter');
+ expect(hover.staticType, 'int');
+ }
+
test_expression_syntheticGetter_invocation() async {
addTestFile('''
library my.library;

Powered by Google App Engine
This is Rietveld 408576698