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

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

Issue 1412213003: Register .analysis_options files for analysis. (Closed) Base URL: git@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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/plugin/server_plugin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index a97ccd9a72f317933dd816886def31a805610e53..c6520d52e154df3687146ff7fad46dba6cafa1b4 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -9,10 +9,8 @@ import 'dart:collection';
import 'dart:convert';
import 'dart:core' hide Resource;
-import 'package:analyzer/src/context/context.dart' as context;
import 'package:analysis_server/plugin/analysis/resolver_provider.dart';
import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/server_options.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/plugin/options.dart';
@@ -22,6 +20,7 @@ import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/source/path_filter.dart';
import 'package:analyzer/source/pub_package_map_provider.dart';
import 'package:analyzer/source/sdk_ext.dart';
+import 'package:analyzer/src/context/context.dart' as context;
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/java_io.dart';
@@ -312,11 +311,6 @@ abstract class ContextManagerCallbacks {
*/
class ContextManagerImpl implements ContextManager {
/**
- * File name of analysis options files.
- */
- static const String ANALYSIS_OPTIONS_FILE = '.analysis_options';
-
- /**
* The name of the `lib` directory.
*/
static const String LIB_DIR_NAME = 'lib';
@@ -734,6 +728,19 @@ class ContextManagerImpl implements ContextManager {
}
}
+ void _checkForAnalysisOptionsUpdate(
+ String path, ContextInfo info, ChangeType changeType) {
+ if (AnalysisEngine.isAnalysisOptionsFileName(path, pathContext)) {
+ var analysisContext = info.context;
+ if (analysisContext is context.AnalysisContextImpl) {
+ processOptionsForContext(info, info.folder,
+ optionsRemoved: changeType == ChangeType.REMOVE);
+ analysisContext.invalidateCachedResults();
+ callbacks.applyChangesToContext(info.folder, new ChangeSet());
+ }
+ }
+ }
+
void _checkForPackagespecUpdate(
String path, ContextInfo info, Folder folder) {
// Check to see if this is the .packages file for this context and if so,
@@ -1157,19 +1164,6 @@ class ContextManagerImpl implements ContextManager {
_checkForAnalysisOptionsUpdate(path, info, event.type);
}
- void _checkForAnalysisOptionsUpdate(
- String path, ContextInfo info, ChangeType changeType) {
- if (pathContext.basename(path) == ANALYSIS_OPTIONS_FILE) {
- var analysisContext = info.context;
- if (analysisContext is context.AnalysisContextImpl) {
- processOptionsForContext(info, info.folder,
- optionsRemoved: changeType == ChangeType.REMOVE);
- analysisContext.invalidateCachedResults();
- callbacks.applyChangesToContext(info.folder, new ChangeSet());
- }
- }
- }
-
/**
* Determine whether the given [path], when interpreted relative to the
* context root [root], contains a folder whose name starts with '.'.
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/plugin/server_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698