OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.task.incremental_element_builder; | 5 library analyzer.src.task.incremental_element_builder; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 * same order as in [newUnit]. Existing resolution is kept where possible. | 126 * same order as in [newUnit]. Existing resolution is kept where possible. |
127 * | 127 * |
128 * Updates [unitElement] by adding/removing elements as needed. | 128 * Updates [unitElement] by adding/removing elements as needed. |
129 * | 129 * |
130 * Fills [unitDelta] with added/remove elements. | 130 * Fills [unitDelta] with added/remove elements. |
131 */ | 131 */ |
132 void build() { | 132 void build() { |
133 _materializeLazyElements(); | 133 _materializeLazyElements(); |
134 new CompilationUnitBuilder() | 134 new CompilationUnitBuilder() |
135 .buildCompilationUnit(unitSource, newUnit, librarySource); | 135 .buildCompilationUnit(unitSource, newUnit, librarySource); |
| 136 newUnit.accept(new EnumMemberBuilder(unitElement.context.typeProvider)); |
136 _processDirectives(); | 137 _processDirectives(); |
137 _processUnitMembers(); | 138 _processUnitMembers(); |
138 _replaceUnitContents(oldUnit, newUnit); | 139 _replaceUnitContents(oldUnit, newUnit); |
139 _findConstants(); | 140 _findConstants(); |
140 newUnit.element = unitElement; | 141 newUnit.element = unitElement; |
141 unitElement.setCodeRange(0, newUnit.endToken.end); | 142 unitElement.setCodeRange(0, newUnit.endToken.end); |
142 } | 143 } |
143 | 144 |
144 void _addElementToUnitHolder(Element element) { | 145 void _addElementToUnitHolder(Element element) { |
145 if (element is ClassElement) { | 146 if (element is ClassElement) { |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 } else if (element is ParameterElementImpl) { | 736 } else if (element is ParameterElementImpl) { |
736 element.setVisibleRange(newOffset, newLength); | 737 element.setVisibleRange(newOffset, newLength); |
737 } | 738 } |
738 } | 739 } |
739 } | 740 } |
740 } | 741 } |
741 } | 742 } |
742 super.visitElement(element); | 743 super.visitElement(element); |
743 } | 744 } |
744 } | 745 } |
OLD | NEW |