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/protocol/protocol.dart'; | 13 import 'package:analysis_server/protocol/protocol.dart'; |
14 import 'package:analysis_server/protocol/protocol_generated.dart' | 14 import 'package:analysis_server/protocol/protocol_generated.dart' |
15 hide AnalysisOptions, Element; | 15 hide AnalysisOptions; |
16 import 'package:analysis_server/src/analysis_logger.dart'; | 16 import 'package:analysis_server/src/analysis_logger.dart'; |
17 import 'package:analysis_server/src/channel/channel.dart'; | 17 import 'package:analysis_server/src/channel/channel.dart'; |
18 import 'package:analysis_server/src/computer/computer_highlights.dart'; | 18 import 'package:analysis_server/src/computer/computer_highlights.dart'; |
19 import 'package:analysis_server/src/computer/computer_highlights2.dart'; | 19 import 'package:analysis_server/src/computer/computer_highlights2.dart'; |
20 import 'package:analysis_server/src/computer/computer_outline.dart'; | 20 import 'package:analysis_server/src/computer/computer_outline.dart'; |
21 import 'package:analysis_server/src/computer/new_notifications.dart'; | 21 import 'package:analysis_server/src/computer/new_notifications.dart'; |
22 import 'package:analysis_server/src/context_manager.dart'; | 22 import 'package:analysis_server/src/context_manager.dart'; |
23 import 'package:analysis_server/src/domains/analysis/navigation.dart'; | 23 import 'package:analysis_server/src/domains/analysis/navigation.dart'; |
24 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart'; | 24 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart'; |
25 import 'package:analysis_server/src/domains/analysis/occurrences.dart'; | 25 import 'package:analysis_server/src/domains/analysis/occurrences.dart'; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 import 'package:analyzer/src/dart/ast/utilities.dart'; | 60 import 'package:analyzer/src/dart/ast/utilities.dart'; |
61 import 'package:analyzer/src/dart/element/ast_provider.dart'; | 61 import 'package:analyzer/src/dart/element/ast_provider.dart'; |
62 import 'package:analyzer/src/generated/engine.dart'; | 62 import 'package:analyzer/src/generated/engine.dart'; |
63 import 'package:analyzer/src/generated/sdk.dart'; | 63 import 'package:analyzer/src/generated/sdk.dart'; |
64 import 'package:analyzer/src/generated/source.dart'; | 64 import 'package:analyzer/src/generated/source.dart'; |
65 import 'package:analyzer/src/generated/source_io.dart'; | 65 import 'package:analyzer/src/generated/source_io.dart'; |
66 import 'package:analyzer/src/generated/utilities_general.dart'; | 66 import 'package:analyzer/src/generated/utilities_general.dart'; |
67 import 'package:analyzer/src/task/dart.dart'; | 67 import 'package:analyzer/src/task/dart.dart'; |
68 import 'package:analyzer/src/util/glob.dart'; | 68 import 'package:analyzer/src/util/glob.dart'; |
69 import 'package:analyzer/task/dart.dart'; | 69 import 'package:analyzer/task/dart.dart'; |
| 70 import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element; |
70 import 'package:front_end/src/base/performace_logger.dart'; | 71 import 'package:front_end/src/base/performace_logger.dart'; |
71 import 'package:front_end/src/incremental/byte_store.dart'; | 72 import 'package:front_end/src/incremental/byte_store.dart'; |
72 import 'package:front_end/src/incremental/file_byte_store.dart'; | 73 import 'package:front_end/src/incremental/file_byte_store.dart'; |
73 import 'package:plugin/plugin.dart'; | 74 import 'package:plugin/plugin.dart'; |
74 import 'package:watcher/watcher.dart'; | 75 import 'package:watcher/watcher.dart'; |
75 | 76 |
76 typedef void OptionUpdater(AnalysisOptionsImpl options); | 77 typedef void OptionUpdater(AnalysisOptionsImpl options); |
77 | 78 |
78 /** | 79 /** |
79 * Enum representing reasons why analysis might be done for a given file. | 80 * Enum representing reasons why analysis might be done for a given file. |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 } | 2182 } |
2182 } | 2183 } |
2183 | 2184 |
2184 @override | 2185 @override |
2185 void updateContextPackageUriResolver(AnalysisContext context) { | 2186 void updateContextPackageUriResolver(AnalysisContext context) { |
2186 analysisServer._onContextsChangedController | 2187 analysisServer._onContextsChangedController |
2187 .add(new ContextsChangedEvent(changed: [context])); | 2188 .add(new ContextsChangedEvent(changed: [context])); |
2188 analysisServer.schedulePerformAnalysisOperation(context); | 2189 analysisServer.schedulePerformAnalysisOperation(context); |
2189 } | 2190 } |
2190 | 2191 |
2191 List<server.HighlightRegion> _computeHighlightRegions(CompilationUnit unit) { | 2192 List<HighlightRegion> _computeHighlightRegions(CompilationUnit unit) { |
2192 if (analysisServer.options.useAnalysisHighlight2) { | 2193 if (analysisServer.options.useAnalysisHighlight2) { |
2193 return new DartUnitHighlightsComputer2(unit).compute(); | 2194 return new DartUnitHighlightsComputer2(unit).compute(); |
2194 } else { | 2195 } else { |
2195 return new DartUnitHighlightsComputer(unit).compute(); | 2196 return new DartUnitHighlightsComputer(unit).compute(); |
2196 } | 2197 } |
2197 } | 2198 } |
2198 | 2199 |
2199 String _computeLibraryName(CompilationUnit unit) { | 2200 String _computeLibraryName(CompilationUnit unit) { |
2200 for (Directive directive in unit.directives) { | 2201 for (Directive directive in unit.directives) { |
2201 if (directive is LibraryDirective && directive.name != null) { | 2202 if (directive is LibraryDirective && directive.name != null) { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 /** | 2362 /** |
2362 * The [PerformanceTag] for time spent in server request handlers. | 2363 * The [PerformanceTag] for time spent in server request handlers. |
2363 */ | 2364 */ |
2364 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 2365 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
2365 | 2366 |
2366 /** | 2367 /** |
2367 * The [PerformanceTag] for time spent in split store microtasks. | 2368 * The [PerformanceTag] for time spent in split store microtasks. |
2368 */ | 2369 */ |
2369 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 2370 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
2370 } | 2371 } |
OLD | NEW |