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

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1844683002: Issue 26106. Don't attempt to incrementally resolve sources without contents. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 newContents = fileContents.data; 1059 newContents = fileContents.data;
1060 entry.modificationTime = fileContents.modificationTime; 1060 entry.modificationTime = fileContents.modificationTime;
1061 if (newContents == originalContents) { 1061 if (newContents == originalContents) {
1062 entry.setValue(CONTENT, newContents, TargetedResult.EMPTY_LIST); 1062 entry.setValue(CONTENT, newContents, TargetedResult.EMPTY_LIST);
1063 changed = false; 1063 changed = false;
1064 } 1064 }
1065 } catch (e) {} 1065 } catch (e) {}
1066 // If not the same content (e.g. the file is being closed without save), 1066 // If not the same content (e.g. the file is being closed without save),
1067 // then force analysis. 1067 // then force analysis.
1068 if (changed) { 1068 if (changed) {
1069 if (!analysisOptions.incremental || 1069 if (newContents == null ||
1070 !analysisOptions.incremental ||
1070 !_tryPoorMansIncrementalResolution(source, newContents)) { 1071 !_tryPoorMansIncrementalResolution(source, newContents)) {
1071 _sourceChanged(source); 1072 _sourceChanged(source);
1072 } 1073 }
1073 } 1074 }
1074 } 1075 }
1075 if (notify && changed) { 1076 if (notify && changed) {
1076 _onSourcesChangedController 1077 _onSourcesChangedController
1077 .add(new SourcesChangedEvent.changedContent(source, newContents)); 1078 .add(new SourcesChangedEvent.changedContent(source, newContents));
1078 } 1079 }
1079 return changed; 1080 return changed;
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 } 2197 }
2197 DartSdk sdk = factory.dartSdk; 2198 DartSdk sdk = factory.dartSdk;
2198 if (sdk == null) { 2199 if (sdk == null) {
2199 throw new IllegalArgumentException( 2200 throw new IllegalArgumentException(
2200 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2201 "The source factory for an SDK analysis context must have a DartUriRes olver");
2201 } 2202 }
2202 return new AnalysisCache( 2203 return new AnalysisCache(
2203 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); 2204 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
2204 } 2205 }
2205 } 2206 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698