Skip to content

Commit 952d837

Browse files
jcollins-gsimolus3
andauthored
update NNBD branch from head (#2758)
* Switch to using CompilationUnitElement.classes (#2743) * Prepare dartdoc_options for migration (#2745) * more specific imports in options * do not allow autoinitialization * dartfmt * parameterize the valueWithContext type * Use alternative constructors instead of externalizing, didn't realize the autodetect was so widely used * more subclasses * Disable the unstable template checks and prepare for 2.14 stable. (#2752) * Disable one of the template checks? and add beta branch for testing * beta is the new stable * empty commit - force check reset * Add a blurb to the README about requiring analysis (#2753) * Allow comment references on generic typedefs (#2756) Co-authored-by: Janice Collins <[email protected]> * Prepare for dartdoc 2.0.0 (#2754) * Prepare for dartdoc 2.0.0 * Update changelog for additional bugfix Co-authored-by: Simon Binder <[email protected]>
1 parent dbbc79e commit 952d837

File tree

9 files changed

+33
-7
lines changed

9 files changed

+33
-7
lines changed

.github/workflows/test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ jobs:
2828
- os: windows-latest
2929
sdk: dev
3030
job: nnbd
31+
exclude:
32+
# Do not try to run flutter against the "stable" sdk,
33+
# it is unlikely to work and produces uninteresting
34+
# results.
35+
- sdk: stable
36+
job: flutter
37+
- sdk: stable
38+
job: sdk-analyzer
3139

3240
steps:
3341
- name: Configure git

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2.0.0
2+
* BREAKING CHANGE: changes to dartdoc options API
3+
to prepare for NNBD migration (#2745, #2744).
4+
* Fix unbound type reference in extension method comment
5+
reference creating a null dereference (#2741, #2740)
6+
* Update to analyzer 2.0. (#2734)
7+
* Fix comment references on generic typedefs in new
8+
lookup code. (#2755, #2756)
9+
110
## 1.0.2
211

312
* Fix where extensions header in library sidebar linked to the

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Run `pub global activate dartdoc` to install the latest version of dartdoc compa
1818

1919
## Generating docs
2020

21-
Run `dartdoc` from the root directory of a package. Here is an example of dartdoc documenting itself:
21+
Run `dartdoc` from the root directory of a package. Your package must analyze without errors
22+
with `dart analyze` or `flutter analyze` as appropriate. Here is an example of dartdoc documenting
23+
itself:
2224

2325
```
2426
$ dartdoc

dartdoc_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dartdoc:
22
linkToSource:
33
root: '.'
4-
uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v1.0.2/%f%#L%l%'
4+
uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v2.0.0/%f%#L%l%'

lib/src/model/typedef.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ class Typedef extends ModelElement
7373
Map<String, CommentReferable> get referenceChildren {
7474
if (_referenceChildren == null) {
7575
_referenceChildren = {};
76-
_referenceChildren
77-
.addEntriesIfAbsent(parameters.explicitOnCollisionWith(this));
76+
77+
// Only consider parameters if this is a function typedef.
78+
if (isCallable) {
79+
_referenceChildren
80+
.addEntriesIfAbsent(parameters.explicitOnCollisionWith(this));
81+
}
7882
_referenceChildren
7983
.addEntriesIfAbsent(typeParameters.explicitOnCollisionWith(this));
8084
}

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Generated code. Do not modify.
2-
const packageVersion = '1.0.2';
2+
const packageVersion = '2.0.0';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dartdoc
22
# Run `grind build` after updating.
3-
version: 1.0.2
3+
version: 2.0.0
44
description: A non-interactive HTML documentation generator for Dart source code.
55
homepage: https://github.com/dart-lang/dartdoc
66
environment:

testing/test_package/lib/features/generalized_typedefs.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ library generalized_typedefs;
1010

1111
typedef T0 = void;
1212
typedef T1 = Function;
13+
14+
/// [List], [String]
1315
typedef T2<X> = List<X>;
1416
typedef T3<X, Y> = Map<X, Y>;
1517
typedef T4 = void Function();

tool/grind.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,8 @@ final _generatedFilesList = <String>[
10621062
'src/generator/html_resources.g.dart',
10631063
'src/generator/templates.aot_renderers_for_html.dart',
10641064
'src/generator/templates.aot_renderers_for_md.dart',
1065-
'src/generator/templates.runtime_renderers.dart',
1065+
// TODO(jcollins-g): https://github.com/dart-lang/dartdoc/issues/2751
1066+
//'src/generator/templates.runtime_renderers.dart',
10661067
'src/version.dart',
10671068
'../test/mustachio/foo.dart',
10681069
].map((s) => path.joinAll(path.posix.split(s)));

0 commit comments

Comments
 (0)