File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 11name : source_gen
2- version : 0.5.0+1
2+ version : 0.5.1-dev
33author :
Dart Team <[email protected] > 44description : Automatic sourcecode generation for Dart
55homepage : https://github.com/dart-lang/source_gen
Original file line number Diff line number Diff line change @@ -115,17 +115,12 @@ void main() {
115115const _generator = const JsonSerializableGenerator ();
116116
117117Future <Element > _getClassForCodeString (String name) async {
118- var elements = await _getElementsForCodeString ();
119-
120- return elements.singleWhere ((e) => e.name == name);
121- }
122-
123- Future <List <Element >> _getElementsForCodeString () async {
124118 if (_compUnit == null ) {
125119 _compUnit = await _getCompilationUnitForString (getPackagePath ());
126120 }
127121
128- return getElementsFromLibraryElement (_compUnit.element.library);
122+ return getElementsFromLibraryElement (_compUnit.element.library)
123+ .singleWhere ((e) => e.name == name);
129124}
130125
131126Future <CompilationUnit > _getCompilationUnitForString (String projectPath) async {
You can’t perform that action at this time.
0 commit comments