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

Unified Diff: pkg/analysis_server/lib/plugin/analyzed_files.dart

Issue 1152013002: Add support for specifying files needing analysis (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/plugin/assist.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/plugin/analyzed_files.dart
diff --git a/pkg/analysis_server/lib/plugin/analyzed_files.dart b/pkg/analysis_server/lib/plugin/analyzed_files.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a0e538cc952dd14a5a950ed595dfdd52dc64657e
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analyzed_files.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Support for client code that extends the set of files being analyzed by the
+ * analysis server.
+ *
+ * Plugins can register a function that takes a [File] and returns a [bool]
+ * indicating whether the plugin is interested in having that file be analyzed.
+ * The analysis server will invoke the contributed functions and analyze the
+ * file if at least one of the functions returns `true`. (The server is not
+ * required to invoke every function with every file.)
+ */
+library analysis_server.plugin.analyzed_files;
+
+import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register
+ * functions that can cause files to be analyzed. The object used as an
+ * extension must be a [ShouldAnalyzeFile] function.
+ */
+final String ANALYZE_FILE_EXTENSION_POINT_ID = Plugin.join(
+ ServerPlugin.UNIQUE_IDENTIFIER, ServerPlugin.ANALYZE_FILE_EXTENSION_POINT);
+
+/**
+ * A function that returns `true` if the given [file] should be analyzed.
+ */
+typedef bool ShouldAnalyzeFile(File file);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/plugin/assist.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698