OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 protocol.server; | 5 library protocol.server; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; | 8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; |
9 import 'package:analysis_server/src/services/correction/fix.dart'; | 9 import 'package:analysis_server/src/services/correction/fix.dart'; |
10 import 'package:analysis_server/src/services/search/search_engine.dart' | 10 import 'package:analysis_server/src/services/search/search_engine.dart' |
(...skipping 25 matching lines...) Expand all Loading... |
36 ErrorProcessor processor = ErrorProcessor.getProcessor(context, error); | 36 ErrorProcessor processor = ErrorProcessor.getProcessor(context, error); |
37 if (processor != null) { | 37 if (processor != null) { |
38 engine.ErrorSeverity severity = processor.severity; | 38 engine.ErrorSeverity severity = processor.severity; |
39 // Errors with null severity are filtered out. | 39 // Errors with null severity are filtered out. |
40 if (severity != null) { | 40 if (severity != null) { |
41 // Specified severities override. | 41 // Specified severities override. |
42 serverErrors | 42 serverErrors |
43 .add(newAnalysisError_fromEngine(lineInfo, error, severity)); | 43 .add(newAnalysisError_fromEngine(lineInfo, error, severity)); |
44 } | 44 } |
45 } else { | 45 } else { |
46 serverErrors.add(newAnalysisError_fromEngine(lineInfo, error)); | 46 AnalysisError error2 = newAnalysisError_fromEngine(lineInfo, error); |
| 47 bool isStrongMode = context.analysisOptions.strongMode; |
| 48 if (isStrongMode && |
| 49 error is engine.StaticWarningCode && |
| 50 (error as engine.StaticWarningCode).isStrongModeError) { |
| 51 error2.severity = AnalysisErrorSeverity.ERROR; |
| 52 } |
| 53 serverErrors.add(error2); |
47 } | 54 } |
48 } | 55 } |
49 return serverErrors; | 56 return serverErrors; |
50 } | 57 } |
51 | 58 |
52 /** | 59 /** |
53 * Adds [edit] to the [FileEdit] for the given [element]. | 60 * Adds [edit] to the [FileEdit] for the given [element]. |
54 */ | 61 */ |
55 void doSourceChange_addElementEdit( | 62 void doSourceChange_addElementEdit( |
56 SourceChange change, engine.Element element, SourceEdit edit) { | 63 SourceChange change, engine.Element element, SourceEdit edit) { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 if (lineInfo != null) { | 266 if (lineInfo != null) { |
260 engine.LineInfo_Location offsetLocation = | 267 engine.LineInfo_Location offsetLocation = |
261 lineInfo.getLocation(range.offset); | 268 lineInfo.getLocation(range.offset); |
262 startLine = offsetLocation.lineNumber; | 269 startLine = offsetLocation.lineNumber; |
263 startColumn = offsetLocation.columnNumber; | 270 startColumn = offsetLocation.columnNumber; |
264 } | 271 } |
265 } | 272 } |
266 return new Location( | 273 return new Location( |
267 source.fullName, range.offset, range.length, startLine, startColumn); | 274 source.fullName, range.offset, range.length, startLine, startColumn); |
268 } | 275 } |
OLD | NEW |