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

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

Issue 1144393006: Bug fixes for the new task model (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/test/services/completion/optype_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/optype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698