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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 1413643006: Rework analyzed files support to use globs (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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index cdf1561b0f9fbdf3f3b4da66e7fc87cbf53bef33..0196090d069fa0eeccf2372e6d5e7303d08ec7eb 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -33,6 +33,7 @@ import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/generated/utilities_general.dart';
+import 'package:glob/glob.dart';
import 'package:plugin/plugin.dart';
typedef void OptionUpdater(AnalysisOptionsImpl options);
@@ -1463,10 +1464,9 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
@override
bool shouldFileBeAnalyzed(File file) {
- List<ShouldAnalyzeFile> functions =
- analysisServer.serverPlugin.analyzeFileFunctions;
- for (ShouldAnalyzeFile shouldAnalyzeFile in functions) {
- if (shouldAnalyzeFile(file)) {
+ List<String> patterns = analysisServer.serverPlugin.analyzedFilePatterns;
+ for (String pattern in patterns) {
+ if (new Glob(pattern).matches(file.path)) {
scheglov 2015/11/02 16:27:49 I wonder if creating Glob instances might be a per
Brian Wilkerson 2015/11/02 16:54:38 It probably would be. I also realized that I'd for
// Emacs creates dummy links to track the fact that a file is open for
// editing and has unsaved changes (e.g. having unsaved changes to
// 'foo.dart' causes a link '.#foo.dart' to be created, which points to

Powered by Google App Engine
This is Rietveld 408576698