| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 | 8 |
| 9 import 'package:analyzer/context/declared_variables.dart'; | 9 import 'package:analyzer/context/declared_variables.dart'; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 return serialized.map((error) { | 1097 return serialized.map((error) { |
| 1098 String errorName = error.uniqueName; | 1098 String errorName = error.uniqueName; |
| 1099 ErrorCode errorCode = | 1099 ErrorCode errorCode = |
| 1100 errorCodeByUniqueName(errorName) ?? _lintCodeByUniqueName(errorName); | 1100 errorCodeByUniqueName(errorName) ?? _lintCodeByUniqueName(errorName); |
| 1101 if (errorCode == null) { | 1101 if (errorCode == null) { |
| 1102 // This could fail because the error code is no longer defined, or, in | 1102 // This could fail because the error code is no longer defined, or, in |
| 1103 // the case of a lint rule, if the lint rule has been disabled since the | 1103 // the case of a lint rule, if the lint rule has been disabled since the |
| 1104 // errors were written. | 1104 // errors were written. |
| 1105 throw new StateError('No ErrorCode for $errorName in $file'); | 1105 throw new StateError('No ErrorCode for $errorName in $file'); |
| 1106 } | 1106 } |
| 1107 return new AnalysisError.forValues(file.source, error.offset, | 1107 return new AnalysisError.forValues( |
| 1108 error.length, errorCode, error.message, error.correction); | 1108 file.source, |
| 1109 error.offset, |
| 1110 error.length, |
| 1111 errorCode, |
| 1112 error.message, |
| 1113 error.correction.isEmpty ? null : error.correction); |
| 1109 }).toList(); | 1114 }).toList(); |
| 1110 } | 1115 } |
| 1111 | 1116 |
| 1112 /** | 1117 /** |
| 1113 * Return the key to store fully resolved results for the [signature]. | 1118 * Return the key to store fully resolved results for the [signature]. |
| 1114 */ | 1119 */ |
| 1115 String _getResolvedUnitKey(String signature) { | 1120 String _getResolvedUnitKey(String signature) { |
| 1116 return '$signature.resolved'; | 1121 return '$signature.resolved'; |
| 1117 } | 1122 } |
| 1118 | 1123 |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 libraryDeclarations.add(new TopLevelDeclarationInSource( | 1933 libraryDeclarations.add(new TopLevelDeclarationInSource( |
| 1929 file.source, declaration, isExported)); | 1934 file.source, declaration, isExported)); |
| 1930 } | 1935 } |
| 1931 } | 1936 } |
| 1932 } | 1937 } |
| 1933 | 1938 |
| 1934 // We're not done yet. | 1939 // We're not done yet. |
| 1935 return false; | 1940 return false; |
| 1936 } | 1941 } |
| 1937 } | 1942 } |
| OLD | NEW |