| 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; |
| 11 import 'dart:math' show max; | 11 import 'dart:math' show max; |
| 12 | 12 |
| 13 import 'package:analysis_server/plugin/protocol/protocol.dart' | 13 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| 14 hide AnalysisOptions, Element; | 14 hide AnalysisOptions, Element; |
| 15 import 'package:analysis_server/src/analysis_logger.dart'; | 15 import 'package:analysis_server/src/analysis_logger.dart'; |
| 16 import 'package:analysis_server/src/channel/channel.dart'; | 16 import 'package:analysis_server/src/channel/channel.dart'; |
| 17 import 'package:analysis_server/src/computer/new_notifications.dart'; | 17 import 'package:analysis_server/src/computer/new_notifications.dart'; |
| 18 import 'package:analysis_server/src/context_manager.dart'; | 18 import 'package:analysis_server/src/context_manager.dart'; |
| 19 import 'package:analysis_server/src/operation/operation.dart'; | 19 import 'package:analysis_server/src/operation/operation.dart'; |
| 20 import 'package:analysis_server/src/operation/operation_analysis.dart'; | 20 import 'package:analysis_server/src/operation/operation_analysis.dart'; |
| 21 import 'package:analysis_server/src/operation/operation_queue.dart'; | 21 import 'package:analysis_server/src/operation/operation_queue.dart'; |
| 22 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 22 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 23 import 'package:analysis_server/src/services/correction/namespace.dart'; | 23 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| 24 import 'package:analysis_server/src/services/index/index.dart'; | 24 import 'package:analysis_server/src/services/index/index.dart'; |
| 25 import 'package:analysis_server/src/services/search/search_engine.dart'; | 25 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 26 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; | 26 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; |
| 27 import 'package:analysis_server/src/services/search/search_engine_internal2.dart
'; | 27 import 'package:analysis_server/src/services/search/search_engine_internal2.dart
'; |
| 28 import 'package:analysis_server/src/single_context_manager.dart'; | 28 import 'package:analysis_server/src/single_context_manager.dart'; |
| 29 import 'package:analysis_server/src/utilities/null_string_sink.dart'; |
| 29 import 'package:analyzer/dart/ast/ast.dart'; | 30 import 'package:analyzer/dart/ast/ast.dart'; |
| 30 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 31 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
| 31 import 'package:analyzer/dart/element/element.dart'; | 32 import 'package:analyzer/dart/element/element.dart'; |
| 32 import 'package:analyzer/exception/exception.dart'; | 33 import 'package:analyzer/exception/exception.dart'; |
| 33 import 'package:analyzer/file_system/file_system.dart'; | 34 import 'package:analyzer/file_system/file_system.dart'; |
| 34 import 'package:analyzer/file_system/physical_file_system.dart'; | 35 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 35 import 'package:analyzer/instrumentation/instrumentation.dart'; | 36 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 36 import 'package:analyzer/plugin/resolver_provider.dart'; | 37 import 'package:analyzer/plugin/resolver_provider.dart'; |
| 37 import 'package:analyzer/source/pub_package_map_provider.dart'; | 38 import 'package:analyzer/source/pub_package_map_provider.dart'; |
| 38 import 'package:analyzer/src/context/builder.dart'; | 39 import 'package:analyzer/src/context/builder.dart'; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 options.enableIncrementalResolutionApi; | 365 options.enableIncrementalResolutionApi; |
| 365 defaultContextOptions.incrementalValidation = | 366 defaultContextOptions.incrementalValidation = |
| 366 options.enableIncrementalResolutionValidation; | 367 options.enableIncrementalResolutionValidation; |
| 367 defaultContextOptions.finerGrainedInvalidation = | 368 defaultContextOptions.finerGrainedInvalidation = |
| 368 options.finerGrainedInvalidation; | 369 options.finerGrainedInvalidation; |
| 369 defaultContextOptions.generateImplicitErrors = false; | 370 defaultContextOptions.generateImplicitErrors = false; |
| 370 operationQueue = new ServerOperationQueue(); | 371 operationQueue = new ServerOperationQueue(); |
| 371 | 372 |
| 372 { | 373 { |
| 373 String name = options.newAnalysisDriverLog; | 374 String name = options.newAnalysisDriverLog; |
| 374 StringSink sink = new _NullStringSink(); | 375 StringSink sink = new NullStringSink(); |
| 375 if (name != null) { | 376 if (name != null) { |
| 376 if (name == 'stdout') { | 377 if (name == 'stdout') { |
| 377 sink = io.stdout; | 378 sink = io.stdout; |
| 378 } else if (name.startsWith('file:')) { | 379 } else if (name.startsWith('file:')) { |
| 379 String path = name.substring('file:'.length); | 380 String path = name.substring('file:'.length); |
| 380 sink = new io.File(path).openWrite(mode: io.FileMode.APPEND); | 381 sink = new io.File(path).openWrite(mode: io.FileMode.APPEND); |
| 381 } | 382 } |
| 382 } | 383 } |
| 383 _analysisPerformanceLogger = new nd.PerformanceLog(sink); | 384 _analysisPerformanceLogger = new nd.PerformanceLog(sink); |
| 384 } | 385 } |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 /** | 2107 /** |
| 2107 * The [PerformanceTag] for time spent in server request handlers. | 2108 * The [PerformanceTag] for time spent in server request handlers. |
| 2108 */ | 2109 */ |
| 2109 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 2110 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
| 2110 | 2111 |
| 2111 /** | 2112 /** |
| 2112 * The [PerformanceTag] for time spent in split store microtasks. | 2113 * The [PerformanceTag] for time spent in split store microtasks. |
| 2113 */ | 2114 */ |
| 2114 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 2115 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 2115 } | 2116 } |
| 2116 | |
| 2117 class _NullStringSink implements StringSink { | |
| 2118 void write(Object obj) {} | |
| 2119 void writeAll(Iterable objects, [String separator = ""]) {} | |
| 2120 void writeCharCode(int charCode) {} | |
| 2121 void writeln([Object obj = ""]) {} | |
| 2122 } | |
| OLD | NEW |