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 5ef0dc4357eff4566bccba529fb935b4d94620d0..a3d2cbfa8ed466bc8ba555196b0fa4aba50d38fb 100644 |
--- a/pkg/analysis_server/lib/src/analysis_server.dart |
+++ b/pkg/analysis_server/lib/src/analysis_server.dart |
@@ -23,6 +23,7 @@ import 'package:analysis_server/src/services/search/search_engine.dart'; |
import 'package:analysis_server/src/source/optimizing_pub_package_map_provider.dart'; |
import 'package:analyzer/file_system/file_system.dart'; |
import 'package:analyzer/instrumentation/instrumentation.dart'; |
+import 'package:analyzer/src/context/context.dart' as newContext; |
import 'package:analyzer/src/generated/ast.dart'; |
import 'package:analyzer/src/generated/element.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
@@ -32,6 +33,9 @@ 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:plugin/plugin.dart'; |
+import 'package:analyzer/src/context/cache.dart'; |
scheglov
2015/06/01 22:19:06
Sort imports?
|
+import 'package:analyzer/task/dart.dart'; |
+import 'package:analyzer/src/task/dart.dart'; |
typedef void OptionUpdater(AnalysisOptionsImpl options); |
@@ -1025,10 +1029,21 @@ class AnalysisServer { |
void test_flushResolvedUnit(String file) { |
if (AnalysisEngine.isDartFileName(file)) { |
ContextSourcePair contextSource = getContextSourcePair(file); |
- AnalysisContextImpl context = contextSource.context; |
+ AnalysisContext context = contextSource.context; |
Source source = contextSource.source; |
- DartEntry dartEntry = context.getReadableSourceEntryOrNull(source); |
- dartEntry.flushAstStructures(); |
+ if (context is AnalysisContextImpl) { |
+ DartEntry dartEntry = context.getReadableSourceEntryOrNull(source); |
+ dartEntry.flushAstStructures(); |
+ } else if (context is newContext.AnalysisContextImpl) { |
+ CacheEntry entry = context.getCacheEntry(source); |
+ entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); |
+ entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); |
+ entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); |
+ entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); |
+ entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); |
+ entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); |
+ entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
+ } |
} |
} |