@@ -1642,12 +1642,20 @@ class AnalysisDriver implements AnalysisDriverGeneric {
1642
1642
stackTrace = state.stackTrace;
1643
1643
contextKey = state.contextKey;
1644
1644
}
1645
+
1645
1646
CaughtException caught = CaughtException (exception, stackTrace);
1646
- String fileContent = _fsState.getFileForPath (path).content;
1647
+
1648
+ var fileContentMap = < String , String > {};
1649
+ var libraryFile = _fsState.getFileForPath (path);
1650
+ for (var file in libraryFile.libraryFiles) {
1651
+ fileContentMap[file.path] = file.content;
1652
+ }
1653
+
1647
1654
_exceptionController.add (
1648
1655
ExceptionResult (
1649
1656
filePath: path,
1650
- fileContent: fileContent,
1657
+ fileContentMap: fileContentMap,
1658
+ fileContent: libraryFile.content,
1651
1659
exception: caught,
1652
1660
contextKey: contextKey,
1653
1661
),
@@ -2140,15 +2148,19 @@ class ErrorEncoding {
2140
2148
2141
2149
/// Exception that happened during analysis.
2142
2150
class ExceptionResult {
2143
- /// The path of the file being analyzed when the [exception] happened.
2151
+ /// The path of the library being analyzed when the [exception] happened.
2144
2152
///
2145
2153
/// Absolute and normalized.
2146
2154
final String filePath;
2147
2155
2156
+ /// The content of the library and its parts.
2157
+ final Map <String , String > fileContentMap;
2158
+
2148
2159
/// The path of the file being analyzed when the [exception] happened.
2160
+ @Deprecated ('Use fileContentMap instead' )
2149
2161
final String fileContent;
2150
2162
2151
- /// The exception during analysis of the file with the [path ] .
2163
+ /// The exception during analysis of the file with the [filePath ] .
2152
2164
final CaughtException exception;
2153
2165
2154
2166
/// If the exception happened during a file analysis, and the context in which
@@ -2159,6 +2171,7 @@ class ExceptionResult {
2159
2171
2160
2172
ExceptionResult ({
2161
2173
@required this .filePath,
2174
+ @required this .fileContentMap,
2162
2175
@required this .fileContent,
2163
2176
@required this .exception,
2164
2177
@required this .contextKey,
0 commit comments