| 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.context.context; | 5 library analyzer.src.context.context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| 11 import 'package:analyzer/dart/ast/resolution_accessors.dart'; |
| 11 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
| 12 import 'package:analyzer/error/error.dart'; | 13 import 'package:analyzer/error/error.dart'; |
| 13 import 'package:analyzer/exception/exception.dart'; | 14 import 'package:analyzer/exception/exception.dart'; |
| 14 import 'package:analyzer/instrumentation/instrumentation.dart'; | 15 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 15 import 'package:analyzer/plugin/resolver_provider.dart'; | 16 import 'package:analyzer/plugin/resolver_provider.dart'; |
| 16 import 'package:analyzer/plugin/task.dart'; | 17 import 'package:analyzer/plugin/task.dart'; |
| 17 import 'package:analyzer/src/cancelable_future.dart'; | 18 import 'package:analyzer/src/cancelable_future.dart'; |
| 18 import 'package:analyzer/src/context/builder.dart' show EmbedderYamlLocator; | 19 import 'package:analyzer/src/context/builder.dart' show EmbedderYamlLocator; |
| 19 import 'package:analyzer/src/context/cache.dart'; | 20 import 'package:analyzer/src/context/cache.dart'; |
| 20 import 'package:analyzer/src/dart/element/element.dart'; | 21 import 'package:analyzer/src/dart/element/element.dart'; |
| (...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1937 bool success = resolver.resolve(newCode); | 1938 bool success = resolver.resolve(newCode); |
| 1938 AnalysisEngine.instance.instrumentationService.logPerformance( | 1939 AnalysisEngine.instance.instrumentationService.logPerformance( |
| 1939 AnalysisPerformanceKind.INCREMENTAL, | 1940 AnalysisPerformanceKind.INCREMENTAL, |
| 1940 perfCounter, | 1941 perfCounter, |
| 1941 'success=$success,context_id=$_id,code_length=${newCode.length}'); | 1942 'success=$success,context_id=$_id,code_length=${newCode.length}'); |
| 1942 if (!success) { | 1943 if (!success) { |
| 1943 return false; | 1944 return false; |
| 1944 } | 1945 } |
| 1945 // if validation, remember the result, but throw it away | 1946 // if validation, remember the result, but throw it away |
| 1946 if (analysisOptions.incrementalValidation) { | 1947 if (analysisOptions.incrementalValidation) { |
| 1947 incrementalResolutionValidation_lastUnitSource = oldUnit.element.source; | 1948 CompilationUnitElement compilationUnitElement = |
| 1949 elementForCompilationUnit(oldUnit); |
| 1950 incrementalResolutionValidation_lastUnitSource = |
| 1951 compilationUnitElement.source; |
| 1948 incrementalResolutionValidation_lastLibrarySource = | 1952 incrementalResolutionValidation_lastLibrarySource = |
| 1949 oldUnit.element.library.source; | 1953 compilationUnitElement.library.source; |
| 1950 incrementalResolutionValidation_lastUnit = oldUnit; | 1954 incrementalResolutionValidation_lastUnit = oldUnit; |
| 1951 return false; | 1955 return false; |
| 1952 } | 1956 } |
| 1953 // prepare notice | 1957 // prepare notice |
| 1954 { | 1958 { |
| 1955 ChangeNoticeImpl notice = getNotice(unitSource); | 1959 ChangeNoticeImpl notice = getNotice(unitSource); |
| 1956 notice.resolvedDartUnit = oldUnit; | 1960 notice.resolvedDartUnit = oldUnit; |
| 1957 AnalysisErrorInfo errorInfo = getErrors(unitSource); | 1961 AnalysisErrorInfo errorInfo = getErrors(unitSource); |
| 1958 notice.setErrors(errorInfo.errors, errorInfo.lineInfo); | 1962 notice.setErrors(errorInfo.errors, errorInfo.lineInfo); |
| 1959 } | 1963 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 } | 2248 } |
| 2245 DartSdk sdk = factory.dartSdk; | 2249 DartSdk sdk = factory.dartSdk; |
| 2246 if (sdk == null) { | 2250 if (sdk == null) { |
| 2247 throw new ArgumentError( | 2251 throw new ArgumentError( |
| 2248 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2252 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
| 2249 } | 2253 } |
| 2250 return new AnalysisCache( | 2254 return new AnalysisCache( |
| 2251 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2255 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 2252 } | 2256 } |
| 2253 } | 2257 } |
| OLD | NEW |