| 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 analysis.server; | 5 library analysis.server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:core'; | 9 import 'dart:core'; |
| 10 import 'dart:io' as io; | 10 import 'dart:io' as io; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 nd.PerformanceLog _analysisPerformanceLogger; | 323 nd.PerformanceLog _analysisPerformanceLogger; |
| 324 ByteStore byteStore; | 324 ByteStore byteStore; |
| 325 nd.AnalysisDriverScheduler analysisDriverScheduler; | 325 nd.AnalysisDriverScheduler analysisDriverScheduler; |
| 326 | 326 |
| 327 /** | 327 /** |
| 328 * The set of the files that are currently priority. | 328 * The set of the files that are currently priority. |
| 329 */ | 329 */ |
| 330 final Set<String> priorityFiles = new Set<String>(); | 330 final Set<String> priorityFiles = new Set<String>(); |
| 331 | 331 |
| 332 /** | 332 /** |
| 333 * The cached results units for [priorityFiles]. | 333 * The cached results for [priorityFiles]. |
| 334 * These results must have not `null` units. |
| 334 */ | 335 */ |
| 335 final Map<String, nd.AnalysisResult> priorityFileResults = {}; | 336 final Map<String, nd.AnalysisResult> priorityFileResults = {}; |
| 336 | 337 |
| 337 /** | 338 /** |
| 338 * Initialize a newly created server to receive requests from and send | 339 * Initialize a newly created server to receive requests from and send |
| 339 * responses to the given [channel]. | 340 * responses to the given [channel]. |
| 340 * | 341 * |
| 341 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are | 342 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are |
| 342 * propagated up the call stack. The default is true to allow analysis | 343 * propagated up the call stack. The default is true to allow analysis |
| 343 * exceptions to show up in unit tests, but it should be set to false when | 344 * exceptions to show up in unit tests, but it should be set to false when |
| (...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1806 resourceProvider, | 1807 resourceProvider, |
| 1807 analysisServer.byteStore, | 1808 analysisServer.byteStore, |
| 1808 analysisServer.fileContentOverlay, | 1809 analysisServer.fileContentOverlay, |
| 1809 sourceFactory, | 1810 sourceFactory, |
| 1810 analysisOptions); | 1811 analysisOptions); |
| 1811 analysisDriver.name = folder.shortName; | 1812 analysisDriver.name = folder.shortName; |
| 1812 analysisDriver.status.listen((status) { | 1813 analysisDriver.status.listen((status) { |
| 1813 // TODO(scheglov) send server status | 1814 // TODO(scheglov) send server status |
| 1814 }); | 1815 }); |
| 1815 analysisDriver.results.listen((result) { | 1816 analysisDriver.results.listen((result) { |
| 1816 if (analysisServer.priorityFiles.contains(result.path)) { | 1817 if (analysisServer.priorityFiles.contains(result.path) && |
| 1818 result.unit != null) { |
| 1817 analysisServer.priorityFileResults[result.path] = result; | 1819 analysisServer.priorityFileResults[result.path] = result; |
| 1818 } | 1820 } |
| 1819 _runDelayed(() { | 1821 _runDelayed(() { |
| 1820 new_sendErrorNotification(analysisServer, result); | 1822 new_sendErrorNotification(analysisServer, result); |
| 1821 }); | 1823 }); |
| 1822 String path = result.path; | 1824 String path = result.path; |
| 1823 CompilationUnit unit = result.unit; | 1825 CompilationUnit unit = result.unit; |
| 1824 if (unit != null) { | 1826 if (unit != null) { |
| 1825 if (analysisServer._hasAnalysisServiceSubscription( | 1827 if (analysisServer._hasAnalysisServiceSubscription( |
| 1826 AnalysisService.HIGHLIGHTS, path)) { | 1828 AnalysisService.HIGHLIGHTS, path)) { |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 */ | 2085 */ |
| 2084 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 2086 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 2085 } | 2087 } |
| 2086 | 2088 |
| 2087 class _NullStringSink implements StringSink { | 2089 class _NullStringSink implements StringSink { |
| 2088 void write(Object obj) {} | 2090 void write(Object obj) {} |
| 2089 void writeAll(Iterable objects, [String separator = ""]) {} | 2091 void writeAll(Iterable objects, [String separator = ""]) {} |
| 2090 void writeCharCode(int charCode) {} | 2092 void writeCharCode(int charCode) {} |
| 2091 void writeln([Object obj = ""]) {} | 2093 void writeln([Object obj = ""]) {} |
| 2092 } | 2094 } |
| OLD | NEW |