From f08c23e330801a4ddd267190ca6c268c3f39f233 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Thu, 1 Jun 2017 14:08:34 -0700 Subject: [PATCH 1/3] add ellipses with link to detailed docs --- lib/src/model.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/src/model.dart b/lib/src/model.dart index 69c3b12589..2d9ff2dcef 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -2059,6 +2059,15 @@ abstract class ModelElement implements Comparable, Nameable, Documentable { return "(${p.toUri(sourceFileName)})"; } + /// Returns a link to extended documentation, or the empty string if that + /// does not exist. + String get extendedDocLink { + if (hasExtendedDocumentation) { + return '[...]'; + } + return ''; + } + /// Returns the fully qualified name. /// /// For example: libraryName.className.methodName @@ -2185,7 +2194,7 @@ abstract class ModelElement implements Comparable, Nameable, Documentable { String get genericParameters => ''; @override - String get oneLineDoc => _documentation.asOneLiner; + String get oneLineDoc => _documentation.asOneLiner + ' ' + extendedDocLink; ModelElement get overriddenElement => null; From cf2943e1a6255558af8883d19889af3dd68b2123 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Mon, 19 Jun 2017 15:25:10 -0700 Subject: [PATCH 2/3] Patch up tests --- lib/src/model.dart | 3 +-- test/model_test.dart | 4 ++-- testing/test_package_docs/ex/Apple-class.html | 4 ++-- testing/test_package_docs/ex/B-class.html | 2 +- testing/test_package_docs/ex/Dog-class.html | 2 +- testing/test_package_docs/ex/F-class.html | 2 +- testing/test_package_docs/ex/ex-library.html | 8 ++++---- .../fake/BaseForDocComments-class.html | 2 +- .../fake/LongFirstLine-class.html | 6 +++--- .../fake/SubForDocComments-class.html | 2 +- .../fake/SuperAwesomeClass-class.html | 2 +- .../fake/WithGetterAndSetter-class.html | 2 +- testing/test_package_docs/fake/fake-library.html | 14 +++++++------- testing/test_package_docs/index.html | 4 ++-- .../two_exports/BaseClass-class.html | 2 +- .../two_exports/ExtendingClass-class.html | 2 +- .../two_exports/two_exports-library.html | 2 +- 17 files changed, 31 insertions(+), 32 deletions(-) diff --git a/lib/src/model.dart b/lib/src/model.dart index 16331a2a4d..0aebe4879a 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -13,7 +13,6 @@ import 'package:analyzer/dart/ast/ast.dart' show AnnotatedNode, Declaration, - FormalParameter, FieldDeclaration, VariableDeclaration, VariableDeclarationList; @@ -2425,7 +2424,7 @@ abstract class ModelElement extends Nameable String get genericParameters => ''; @override - String get oneLineDoc => _documentation.asOneLiner + ' ' + extendedDocLink; + String get oneLineDoc => '${_documentation.asOneLiner}${extendedDocLink.isEmpty ? "" : " $extendedDocLink"}'; ModelElement get overriddenElement => null; diff --git a/test/model_test.dart b/test/model_test.dart index b249f94435..f456ccd48b 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -196,7 +196,7 @@ void main() { expect( fakeLibrary.oneLineDoc, equals( - 'WOW FAKE PACKAGE IS BEST PACKAGE')); + 'WOW FAKE PACKAGE IS BEST PACKAGE [...]')); }); test('has properties', () { @@ -493,7 +493,7 @@ void main() { expect( add.oneLineDoc, equals( - 'Adds value to the end of this list,\nextending the length by one.')); + 'Adds value to the end of this list,\nextending the length by one. [...]')); }); test( diff --git a/testing/test_package_docs/ex/Apple-class.html b/testing/test_package_docs/ex/Apple-class.html index 39453f50bd..81e2024800 100644 --- a/testing/test_package_docs/ex/Apple-class.html +++ b/testing/test_package_docs/ex/Apple-class.html @@ -166,7 +166,7 @@

Properties

- The getter for s + The getter for s [...]
read / write
@@ -206,7 +206,7 @@

Methods

- This is a method. + This is a method. [...]
diff --git a/testing/test_package_docs/ex/B-class.html b/testing/test_package_docs/ex/B-class.html index 14d9355a2e..26ffb43f76 100644 --- a/testing/test_package_docs/ex/B-class.html +++ b/testing/test_package_docs/ex/B-class.html @@ -240,7 +240,7 @@

Methods

- This is a method. + This is a method. [...]
diff --git a/testing/test_package_docs/ex/Dog-class.html b/testing/test_package_docs/ex/Dog-class.html index 9ea3f91cc6..f1d038d0a6 100644 --- a/testing/test_package_docs/ex/Dog-class.html +++ b/testing/test_package_docs/ex/Dog-class.html @@ -313,7 +313,7 @@

Methods

- Macro method + Macro method [...]
diff --git a/testing/test_package_docs/ex/F-class.html b/testing/test_package_docs/ex/F-class.html index 92867fa6f8..98ba68b23a 100644 --- a/testing/test_package_docs/ex/F-class.html +++ b/testing/test_package_docs/ex/F-class.html @@ -327,7 +327,7 @@

Methods

- Macro method + Macro method [...]
inherited
diff --git a/testing/test_package_docs/ex/ex-library.html b/testing/test_package_docs/ex/ex-library.html index fd47c65904..359427be50 100644 --- a/testing/test_package_docs/ex/ex-library.html +++ b/testing/test_package_docs/ex/ex-library.html @@ -67,7 +67,7 @@

Classes

Apple
- Sample class String + Sample class String [...]
aThingToDo @@ -79,7 +79,7 @@

Classes

B
- Extends class Apple, use new Apple or new Apple.fromString + Extends class Apple, use new Apple or new Apple.fromString [...]
Cat @@ -115,7 +115,7 @@

Classes

Dog
- implements Cat, E + implements Cat, E [...]
E @@ -171,7 +171,7 @@

Classes

ShapeType
- Foo bar. + Foo bar. [...]
SpecializedDuration diff --git a/testing/test_package_docs/fake/BaseForDocComments-class.html b/testing/test_package_docs/fake/BaseForDocComments-class.html index 3fd7458492..13d917488f 100644 --- a/testing/test_package_docs/fake/BaseForDocComments-class.html +++ b/testing/test_package_docs/fake/BaseForDocComments-class.html @@ -186,7 +186,7 @@

Methods

- Takes a value and returns a String. + Takes a value and returns a String. [...]
diff --git a/testing/test_package_docs/fake/LongFirstLine-class.html b/testing/test_package_docs/fake/LongFirstLine-class.html index 753357fe3a..2e40138e1e 100644 --- a/testing/test_package_docs/fake/LongFirstLine-class.html +++ b/testing/test_package_docs/fake/LongFirstLine-class.html @@ -174,7 +174,7 @@

Constructors

LongFirstLine.fromMap(Map data)
- Named constructors are awesome. + Named constructors are awesome. [...]
@@ -282,7 +282,7 @@

Methods

- In the super class. + In the super class. [...]
inherited
@@ -390,7 +390,7 @@

Static Methods

- Just a static method with no parameters. + Just a static method with no parameters. [...]
diff --git a/testing/test_package_docs/fake/SubForDocComments-class.html b/testing/test_package_docs/fake/SubForDocComments-class.html index 8aface88da..4f016f30a7 100644 --- a/testing/test_package_docs/fake/SubForDocComments-class.html +++ b/testing/test_package_docs/fake/SubForDocComments-class.html @@ -200,7 +200,7 @@

Methods

- Takes a value and returns a String. + Takes a value and returns a String. [...]
inherited
diff --git a/testing/test_package_docs/fake/SuperAwesomeClass-class.html b/testing/test_package_docs/fake/SuperAwesomeClass-class.html index 5b7ccc3ecd..654a2625cd 100644 --- a/testing/test_package_docs/fake/SuperAwesomeClass-class.html +++ b/testing/test_package_docs/fake/SuperAwesomeClass-class.html @@ -193,7 +193,7 @@

Methods

- In the super class. + In the super class. [...]
diff --git a/testing/test_package_docs/fake/WithGetterAndSetter-class.html b/testing/test_package_docs/fake/WithGetterAndSetter-class.html index 48ee2a877d..cce530fe32 100644 --- a/testing/test_package_docs/fake/WithGetterAndSetter-class.html +++ b/testing/test_package_docs/fake/WithGetterAndSetter-class.html @@ -158,7 +158,7 @@

Properties

- Returns a length. + Returns a length. [...]
read / write
diff --git a/testing/test_package_docs/fake/fake-library.html b/testing/test_package_docs/fake/fake-library.html index dbc0e918ea..eff709ce89 100644 --- a/testing/test_package_docs/fake/fake-library.html +++ b/testing/test_package_docs/fake/fake-library.html @@ -110,7 +110,7 @@

Classes

ConstantClass
- For make-better testing of constants. + For make-better testing of constants. [...]
Cool @@ -160,7 +160,7 @@

Classes

This is a very long line spread -across... wait for it... two physical lines. +across... wait for it... two physical lines. [...]
MixMeIn @@ -326,7 +326,7 @@

Constants

→ String
- Up is a direction. + Up is a direction. [...]
'up' @@ -399,7 +399,7 @@

Properties

- The getter for setAndGet. + The getter for setAndGet. [...]
read / write
@@ -442,7 +442,7 @@

Functions

- This function has two parameters that are functions. + This function has two parameters that are functions. [...]
@@ -496,7 +496,7 @@

Functions

- Testing NAME_WITH_TWO_UNDERSCORES should not be italicized. + Testing NAME_WITH_TWO_UNDERSCORES should not be italicized. [...]
@@ -533,7 +533,7 @@

Functions

- Top-level function 3 params and 1 optional positional param. + Top-level function 3 params and 1 optional positional param. [...]
diff --git a/testing/test_package_docs/index.html b/testing/test_package_docs/index.html index ffac8ada82..9dbfbc983f 100644 --- a/testing/test_package_docs/index.html +++ b/testing/test_package_docs/index.html @@ -93,7 +93,7 @@

Libraries

void main() { // in Dart! } - + [...]
css @@ -112,7 +112,7 @@

Libraries

fake
- WOW FAKE PACKAGE IS BEST PACKAGE + WOW FAKE PACKAGE IS BEST PACKAGE [...]
is_deprecated diff --git a/testing/test_package_docs/two_exports/BaseClass-class.html b/testing/test_package_docs/two_exports/BaseClass-class.html index 8d1c8a858e..129ce0f8a6 100644 --- a/testing/test_package_docs/two_exports/BaseClass-class.html +++ b/testing/test_package_docs/two_exports/BaseClass-class.html @@ -105,7 +105,7 @@

Properties

- Returns a length. + Returns a length. [...]
read / write, inherited
diff --git a/testing/test_package_docs/two_exports/ExtendingClass-class.html b/testing/test_package_docs/two_exports/ExtendingClass-class.html index 1709124b66..8fdf466d3f 100644 --- a/testing/test_package_docs/two_exports/ExtendingClass-class.html +++ b/testing/test_package_docs/two_exports/ExtendingClass-class.html @@ -107,7 +107,7 @@

Properties

- Returns a length. + Returns a length. [...]
read / write, inherited
diff --git a/testing/test_package_docs/two_exports/two_exports-library.html b/testing/test_package_docs/two_exports/two_exports-library.html index a9d9ec17d2..d06459f8b8 100644 --- a/testing/test_package_docs/two_exports/two_exports-library.html +++ b/testing/test_package_docs/two_exports/two_exports-library.html @@ -70,7 +70,7 @@

Classes

ExtendingClass
- Extending class extends BaseClass. + Extending class extends BaseClass. [...]
From 8e2968743a6b990e67d159804fa9040511894e32 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Mon, 19 Jun 2017 15:25:19 -0700 Subject: [PATCH 3/3] dartfmt --- lib/src/model.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/model.dart b/lib/src/model.dart index 0aebe4879a..1690f7c25f 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -2424,7 +2424,8 @@ abstract class ModelElement extends Nameable String get genericParameters => ''; @override - String get oneLineDoc => '${_documentation.asOneLiner}${extendedDocLink.isEmpty ? "" : " $extendedDocLink"}'; + String get oneLineDoc => + '${_documentation.asOneLiner}${extendedDocLink.isEmpty ? "" : " $extendedDocLink"}'; ModelElement get overriddenElement => null;