| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 /** |
| 6 * Support for client code that extends the analysis aspect of analysis server. |
| 7 */ |
| 8 library analysis_server.analysis; |
| 9 |
| 10 import 'dart:async'; |
| 11 |
| 12 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 13 import 'package:analysis_server/src/protocol.dart' show AnalysisService; |
| 14 import 'package:analyzer/src/generated/engine.dart' |
| 15 show AnalysisContext, ComputedResult; |
| 16 import 'package:analyzer/src/generated/source.dart' show Source; |
| 17 import 'package:analyzer/task/model.dart' show ResultDescriptor; |
| 18 import 'package:plugin/plugin.dart'; |
| 19 |
| 20 /** |
| 21 * The identifier of the extension point that allows plugins to get access to |
| 22 * `AnalysisSite`. The object used as an extension must be |
| 23 * a [SetAnalysisDomain]. |
| 24 */ |
| 25 final String SET_ANALYSIS_DOMAIN_EXTENSION_POINT_ID = Plugin.join( |
| 26 ServerPlugin.UNIQUE_IDENTIFIER, |
| 27 ServerPlugin.SET_ANALISYS_DOMAIN_EXTENSION_POINT); |
| 28 |
| 29 /** |
| 30 * A function that is invoked on the `analysis` domain creation. |
| 31 */ |
| 32 typedef void SetAnalysisDomain(AnalysisDomain site); |
| 33 |
| 34 /** |
| 35 * An object that gives [SetAnalysisDomain]s access to the `analysis` domain |
| 36 * of the analysis server. |
| 37 * |
| 38 * Clients are not expected to subtype this class. |
| 39 */ |
| 40 abstract class AnalysisDomain { |
| 41 /** |
| 42 * Return the stream that is notified when a new value for the given |
| 43 * [descriptor] is computed. |
| 44 */ |
| 45 Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor); |
| 46 |
| 47 /** |
| 48 * Schedule sending the given [service] notifications for the given [source] |
| 49 * in the given [context]. |
| 50 */ |
| 51 void scheduleNotification( |
| 52 AnalysisContext context, Source source, AnalysisService service); |
| 53 } |
| OLD | NEW |