update sample code analyzer regexp & test case (#30201)
updates the regex the analyzer uses, so it should be able to recognize expressions such as const Foo a = Foo(); as "other code" rather than a constructor call.
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
|
||||
// Examples can assume:
|
||||
// bool _visible = true;
|
||||
// class _Text extends Text {
|
||||
// const _Text(String text) : super(text);
|
||||
// const _Text.__(String text) : super(text);
|
||||
// }
|
||||
|
||||
/// A blabla that blabla its blabla blabla blabla.
|
||||
///
|
||||
@@ -41,3 +45,41 @@
|
||||
/// )
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// regular const constructor
|
||||
///
|
||||
/// ```dart
|
||||
/// const Text('Poor wandering ones!')
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// const private constructor
|
||||
/// ```dart
|
||||
/// const _Text('Poor wandering ones!')
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// yet another const private constructor
|
||||
/// ```dart
|
||||
/// const _Text.__('Poor wandering ones!')
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// const variable
|
||||
///
|
||||
/// ```dart
|
||||
/// const text0 = Text('Poor wandering ones!');
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// more const variables
|
||||
///
|
||||
/// ```dart
|
||||
/// const text1 = _Text('Poor wandering ones!');
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
|
||||
Reference in New Issue
Block a user