diff --git a/lib/src/model.dart b/lib/src/model.dart index 69c3b12589..e2fe82f3ba 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -1880,10 +1880,7 @@ abstract class ModelElement implements Comparable, Nameable, Documentable { node = node.parent; } metadata = node.metadata; - } else if (element.computeNode() is! FormalParameter) { - // TODO(jcollins-g): This is special cased to suppress annotations for - // parameters in constructor documentation. Do we - // want to do this? + } else { metadata = element.metadata; } return annotationsFromMetadata(metadata); diff --git a/test/model_test.dart b/test/model_test.dart index cd4d5cbb82..5c73cddf1a 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -1627,6 +1627,13 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, expect(params, contains(', ')); }); + test('param with annotations', () { + ModelFunction method = + fakeLibrary.functions.firstWhere((f) => f.name == 'paintImage1'); + String params = method.linkedParams(); + expect(params, contains('@required')); + }); + test('param exported in library', () { var param = paramFromExportLib.parameters[0]; expect(param.name, equals('helper')); diff --git a/testing/test_package_docs/fake/onlyPositionalWithNoDefaultNoType.html b/testing/test_package_docs/fake/onlyPositionalWithNoDefaultNoType.html index d2f54cb3ee..ee6926d940 100644 --- a/testing/test_package_docs/fake/onlyPositionalWithNoDefaultNoType.html +++ b/testing/test_package_docs/fake/onlyPositionalWithNoDefaultNoType.html @@ -135,7 +135,7 @@
A single optional positional param, no type annotation, no default value.
diff --git a/testing/test_package_docs/fake/paintImage1.html b/testing/test_package_docs/fake/paintImage1.html index bc0bf85a01..a5234b14fd 100644 --- a/testing/test_package_docs/fake/paintImage1.html +++ b/testing/test_package_docs/fake/paintImage1.html @@ -130,7 +130,7 @@Paints an image into the given rectangle in the canvas.
diff --git a/testing/test_package_docs/fake/paintImage2.html b/testing/test_package_docs/fake/paintImage2.html index ec9951019b..98fd081af0 100644 --- a/testing/test_package_docs/fake/paintImage2.html +++ b/testing/test_package_docs/fake/paintImage2.html @@ -130,7 +130,7 @@Paints an image into the given rectangle in the canvas.