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

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1768613002: Update codeOffset/codeLength during incremental resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Extract comparing values. Created 4 years, 10 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/analyzer/lib/src/generated/incremental_resolution_validator.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index fc8c86022a9bbf20183d4af44943a73f0bb9df01..9f4e41939e59f2d3603ee4fe6452943b01a72071 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -2087,6 +2087,22 @@ class _ElementOffsetUpdater extends GeneralizingElementVisitor {
}
}
}
+ // code range
+ if (element is ElementImpl) {
+ int oldOffset = element.codeOffset;
+ int oldLength = element.codeLength;
+ if (oldOffset != null) {
+ int newOffset = oldOffset;
+ int newLength = oldLength;
+ newOffset += oldOffset > updateOffset ? updateDelta : 0;
+ if (oldOffset <= updateOffset && updateOffset < oldOffset + oldLength) {
+ newLength += updateDelta;
+ }
+ if (newOffset != oldOffset || newLength != oldLength) {
+ element.setCodeRange(newOffset, newLength);
+ }
+ }
+ }
// visible range
if (element is LocalElement) {
SourceRange visibleRange = element.visibleRange;
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698