Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: pkg/analyzer/lib/src/error_formatter.dart

Issue 902383002: Tweak to error formatter to fix LINT display name. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 error_formatter; 5 library error_formatter;
6 6
7 import 'package:analyzer/src/analyzer_impl.dart'; 7 import 'package:analyzer/src/analyzer_impl.dart';
8 8
9 import '../options.dart'; 9 import '../options.dart';
10 import 'generated/engine.dart'; 10 import 'generated/engine.dart';
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 out.write('|'); 49 out.write('|');
50 out.write(location.lineNumber); 50 out.write(location.lineNumber);
51 out.write('|'); 51 out.write('|');
52 out.write(location.columnNumber); 52 out.write(location.columnNumber);
53 out.write('|'); 53 out.write('|');
54 out.write(length); 54 out.write(length);
55 out.write('|'); 55 out.write('|');
56 out.write(escapePipe(error.message)); 56 out.write(escapePipe(error.message));
57 } else { 57 } else {
58 String errorType = severity.displayName; 58 String errorType = severity.displayName;
59 if (error.errorCode.type == ErrorType.HINT) { 59 if (error.errorCode.type == ErrorType.HINT ||
60 error.errorCode.type == ErrorType.LINT) {
60 errorType = error.errorCode.type.displayName; 61 errorType = error.errorCode.type.displayName;
61 } 62 }
62 // [warning] 'foo' is not a... (/Users/.../tmp/foo.dart, line 1, col 2) 63 // [warning] 'foo' is not a... (/Users/.../tmp/foo.dart, line 1, col 2)
63 out.write('[$errorType] ${error.message} '); 64 out.write('[$errorType] ${error.message} ');
64 out.write('(${source.fullName}'); 65 out.write('(${source.fullName}');
65 out.write(', line ${location.lineNumber}, col ${location.columnNumber})'); 66 out.write(', line ${location.lineNumber}, col ${location.columnNumber})');
66 } 67 }
67 out.writeln(); 68 out.writeln();
68 } 69 }
69 70
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 193 }
193 194
194 static String pluralize(String word, int count) { 195 static String pluralize(String word, int count) {
195 if (count == 1) { 196 if (count == 1) {
196 return word; 197 return word;
197 } else { 198 } else {
198 return word + "s"; 199 return word + "s";
199 } 200 }
200 } 201 }
201 } 202 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698