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

Side by Side Diff: pkg/analysis_server/lib/src/plugin/server_plugin.dart

Issue 839833002: Initial plugin API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Convert interfaces to typedefs Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 library analysis_server.src.plugin.plugin_impl;
6
7 import 'package:analysis_server/plugin/plugin.dart';
8 import 'package:analysis_server/src/domain_server.dart';
9 import 'package:analysis_server/src/protocol.dart';
10
11 /**
12 * A plugin that defines the extension points and extensions that are inherently
13 * defined by the analysis server.
14 */
15 class ServerPlugin implements Plugin {
16 /**
17 * The simple identifier of the extension point that allows plugins to
18 * register new domains with the server.
19 */
20 static const String DOMAIN_EXTENSION_POINT = 'domain';
21
22 /**
23 * The unique identifier of this plugin.
24 */
25 static const String UNIQUE_IDENTIFIER = 'analysis_server.core';
26
27 /**
28 * Initialize a newly created plugin.
29 */
30 ServerPlugin();
31
32 @override
33 String get uniqueIdentifier => UNIQUE_IDENTIFIER;
34
35 @override
36 void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
37 registerExtensionPoint(
38 DOMAIN_EXTENSION_POINT,
39 (Object extension) => extension is RequestHandler);
40 }
41
42 @override
43 void registerExtensions(RegisterExtension registerExtension) {
44 String domainId = Plugin.join(UNIQUE_IDENTIFIER, DOMAIN_EXTENSION_POINT);
45 // TODO(brianwilkerson) Either figure out how to get access to the server
46 // (to pass it to the constructor), or rework the request handlers so that
47 // we can pass the server in later.
48 registerExtension(domainId, new ServerDomainHandler(null));
49 }
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698