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

Side by Side Diff: pkg/analysis_server/lib/plugin/analysis/analyzed_files.dart

Issue 1392253002: Restructure the public API for server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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 /** 5 /**
6 * Support for client code that extends the set of files being analyzed by the 6 * Support for client code that extends the set of files being analyzed by the
7 * analysis server. 7 * analysis server.
8 * 8 *
9 * Plugins can register a function that takes a [File] and returns a [bool] 9 * Plugins can register a function that takes a [File] and returns a [bool]
10 * indicating whether the plugin is interested in having that file be analyzed. 10 * indicating whether the plugin is interested in having that file be analyzed.
11 * The analysis server will invoke the contributed functions and analyze the 11 * The analysis server will invoke the contributed functions and analyze the
12 * file if at least one of the functions returns `true`. (The server is not 12 * file if at least one of the functions returns `true`. (The server is not
13 * required to invoke every function with every file.) 13 * required to invoke every function with every file.)
14 * 14 *
15 * If a plugin is interested in analyzing a certain kind of files, it needs to 15 * If a plugin is interested in analyzing a certain kind of files, it needs to
16 * ensure that files of that kind will be analyzed. It should register a 16 * ensure that files of that kind will be analyzed. It should register a
17 * function by including code like the following in the plugin's 17 * function by including code like the following in the plugin's
18 * registerExtensions method: 18 * registerExtensions method:
19 * 19 *
20 * @override 20 * @override
21 * void registerExtensions(RegisterExtension registerExtension) { 21 * void registerExtensions(RegisterExtension registerExtension) {
22 * ... 22 * ...
23 * registerExtension( 23 * registerExtension(
24 * ANALYZE_FILE_EXTENSION_POINT_ID, 24 * ANALYZE_FILE_EXTENSION_POINT_ID,
25 * (File file) => file.path.endsWith(...)); 25 * (File file) => file.path.endsWith(...));
26 * ... 26 * ...
27 * } 27 * }
28 */ 28 */
29 library analysis_server.plugin.analyzed_files; 29 library analysis_server.plugin.analysis.analyzed_files;
30 30
31 import 'package:analysis_server/src/plugin/server_plugin.dart'; 31 import 'package:analysis_server/src/plugin/server_plugin.dart';
32 import 'package:analyzer/file_system/file_system.dart'; 32 import 'package:analyzer/file_system/file_system.dart';
33 import 'package:plugin/plugin.dart'; 33 import 'package:plugin/plugin.dart';
34 34
35 /** 35 /**
36 * The identifier of the extension point that allows plugins to register 36 * The identifier of the extension point that allows plugins to register
37 * functions that can cause files to be analyzed. The object used as an 37 * functions that can cause files to be analyzed. The object used as an
38 * extension must be a [ShouldAnalyzeFile] function. 38 * extension must be a [ShouldAnalyzeFile] function.
39 */ 39 */
40 final String ANALYZE_FILE_EXTENSION_POINT_ID = Plugin.join( 40 final String ANALYZE_FILE_EXTENSION_POINT_ID = Plugin.join(
41 ServerPlugin.UNIQUE_IDENTIFIER, ServerPlugin.ANALYZE_FILE_EXTENSION_POINT); 41 ServerPlugin.UNIQUE_IDENTIFIER, ServerPlugin.ANALYZE_FILE_EXTENSION_POINT);
42 42
43 /** 43 /**
44 * A function that returns `true` if the given [file] should be analyzed. 44 * A function that returns `true` if the given [file] should be analyzed.
45 */ 45 */
46 typedef bool ShouldAnalyzeFile(File file); 46 typedef bool ShouldAnalyzeFile(File file);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698