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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 1234293003: Make analysis_server use ignore patterns from .analysis_options file (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « pkg/analysis_server/lib/src/context_manager.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/context_manager_test.dart
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index b60142f5ca2e5e01351d80643f3f8b86965b3c6e..959b8de578e06bec98fa98894618ffb509b7aad0 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -13,7 +13,6 @@ import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/source/package_map_resolver.dart';
-import 'package:analyzer/source/path_filter.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
@@ -198,6 +197,32 @@ class AbstractContextManagerTest {
expect(files[0], equals('/my/proj/lib/main.dart'));
}
+ test_path_filter_analysis_option() async {
+ // Create files.
+ String libPath = newFolder([projPath, LIB_NAME]);
+ newFile([libPath, 'main.dart']);
+ newFile([libPath, 'nope.dart']);
+ String sdkExtPath = newFolder([projPath, 'sdk_ext']);
+ newFile([sdkExtPath, 'entry.dart']);
+ String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
+ newFile([sdkExtSrcPath, 'part.dart']);
+ // Setup analysis options file with ignore list.
+ newFile([projPath, '.analysis_options'], r'''
+analyzer:
+ exclude:
+ - lib/nope.dart
+ - 'sdk_ext/**'
+''');
+ // Setup context.
+ manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+ // Verify that analysis options was parsed and the ignore patterns applied.
+ Map<String, int> fileTimestamps = manager.currentContextFilePaths[projPath];
+ expect(fileTimestamps, isNotEmpty);
+ List<String> files = fileTimestamps.keys.toList();
+ expect(files.length, equals(1));
+ expect(files[0], equals('/my/proj/lib/main.dart'));
+ }
+
test_refresh_oneContext() {
// create two contexts with pubspec.yaml files
String pubspecPath = posix.join(projPath, 'pubspec.yaml');
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698