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

Unified Diff: dart/site/try/src/compilation.dart

Issue 345143002: Handle incremental diagnostics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r37595. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/site/try/src/decoration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/compilation.dart
diff --git a/dart/site/try/src/compilation.dart b/dart/site/try/src/compilation.dart
index 1817c24a09fa6dd06a616e7b4e1b6570d037a7ba..2fe3e2bfa04249ceab323f681d7717c7d83be768 100644
--- a/dart/site/try/src/compilation.dart
+++ b/dart/site/try/src/compilation.dart
@@ -30,6 +30,7 @@ import 'run.dart' show
import 'ui.dart' show
buildButton,
+ interaction,
outputDiv,
outputFrame;
@@ -72,6 +73,7 @@ class CompilationProcess {
final String source;
final Element console;
final ReceivePort receivePort = new ReceivePort();
+ final Set<String> seenMessages = new Set<String>();
bool isCleared = false;
bool isDone = false;
bool usesDartHtml = false;
@@ -112,6 +114,7 @@ class CompilationProcess {
if (verboseCompiler) options.add('--verbose');
if (minified) options.add('--minify');
if (onlyAnalyze) options.add('--analyze-only');
+ interaction.compilationStarting();
compilerPort.send([['options', options], receivePort.sendPort]);
console.appendHtml('<i class="icon-spinner icon-spin"></i>');
console.appendText(' Compiling Dart program...\n');
@@ -151,6 +154,7 @@ class CompilationProcess {
}
onDone(_) {
+ interaction.onCompilationDone();
isDone = true;
receivePort.close();
}
@@ -245,6 +249,7 @@ self.importScripts("$url");
}
onDiagnostic(Map<String, dynamic> diagnostic) {
+ if (currentSource != source) return;
String kind = diagnostic['kind'];
String message = diagnostic['message'];
if (kind == 'verbose info') {
@@ -256,17 +261,17 @@ self.importScripts("$url");
return;
}
String uri = diagnostic['uri'];
- if (uri == null) {
- clear();
- consolePrint(message);
+ if (uri != '${PRIVATE_SCHEME}:/main.dart') {
+ consolePrint('$uri: [$kind] $message');
return;
}
- if (uri != '${PRIVATE_SCHEME}:/main.dart') return;
- if (currentSource != source) return;
int begin = diagnostic['begin'];
int end = diagnostic['end'];
if (begin == null) return;
- addDiagnostic(kind, message, begin, end);
+ if (seenMessages.add('$begin:$end: [$kind] $message')) {
+ // Guard against duplicated messages.
+ addDiagnostic(kind, message, begin, end);
+ }
}
onCrash(data) {
« no previous file with comments | « no previous file | dart/site/try/src/decoration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698