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 set of files being analyzed by the |
| 7 * analysis server. |
| 8 * |
| 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. |
| 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 |
| 13 * required to invoke every function with every file.) |
| 14 */ |
| 15 library analysis_server.plugin.analyzed_files; |
| 16 |
| 17 import 'package:analysis_server/edit/assist/assist_core.dart'; |
| 18 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 19 import 'package:analyzer/file_system/file_system.dart'; |
| 20 import 'package:plugin/plugin.dart'; |
| 21 |
| 22 /** |
| 23 * The identifier of the extension point that allows plugins to register |
| 24 * functions that can cause files to be analyzed. The object used as an |
| 25 * extension must be a [ShouldAnalyzeFile] function. |
| 26 */ |
| 27 final String ANALYZE_FILE_EXTENSION_POINT_ID = Plugin.join( |
| 28 ServerPlugin.UNIQUE_IDENTIFIER, ServerPlugin.ANALYZE_FILE_EXTENSION_POINT); |
| 29 |
| 30 /** |
| 31 * A function that returns `true` if the given [file] should be analyzed. |
| 32 */ |
| 33 typedef bool ShouldAnalyzeFile(File file); |
OLD | NEW |