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

Side by Side Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1657463002: Element no longer implements AnalysisTarget Base URL: git@github.com:dart-lang/sdk.git@fixhash
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.generated.incremental_resolver; 5 library analyzer.src.generated.incremental_resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 final int updateDelta; 2058 final int updateDelta;
2059 final AnalysisCache cache; 2059 final AnalysisCache cache;
2060 2060
2061 _ElementOffsetUpdater(this.updateOffset, this.updateDelta, this.cache); 2061 _ElementOffsetUpdater(this.updateOffset, this.updateDelta, this.cache);
2062 2062
2063 @override 2063 @override
2064 visitElement(Element element) { 2064 visitElement(Element element) {
2065 // name offset 2065 // name offset
2066 int nameOffset = element.nameOffset; 2066 int nameOffset = element.nameOffset;
2067 if (nameOffset > updateOffset) { 2067 if (nameOffset > updateOffset) {
2068 cache.remove(element); 2068 if (element is AnalysisTarget) {
2069 cache.remove(element as AnalysisTarget);
Brian Wilkerson 2016/02/01 15:43:20 Is the cast necessary? I would have thought that t
2070 }
2069 (element as ElementImpl).nameOffset = nameOffset + updateDelta; 2071 (element as ElementImpl).nameOffset = nameOffset + updateDelta;
2070 } 2072 }
2071 // visible range 2073 // visible range
2072 if (element is LocalElement) { 2074 if (element is LocalElement) {
2073 SourceRange visibleRange = element.visibleRange; 2075 SourceRange visibleRange = element.visibleRange;
2074 if (visibleRange != null && visibleRange.offset > updateOffset) { 2076 if (visibleRange != null && visibleRange.offset > updateOffset) {
2075 int newOffset = visibleRange.offset + updateDelta; 2077 int newOffset = visibleRange.offset + updateDelta;
2076 int length = visibleRange.length; 2078 int length = visibleRange.length;
2077 if (element is FunctionElementImpl) { 2079 if (element is FunctionElementImpl) {
2078 cache.remove(element);
2079 element.setVisibleRange(newOffset, length); 2080 element.setVisibleRange(newOffset, length);
2080 } else if (element is LocalVariableElementImpl) { 2081 } else if (element is LocalVariableElementImpl) {
2081 cache.remove(element); 2082 cache.remove(element);
2082 element.setVisibleRange(newOffset, length); 2083 element.setVisibleRange(newOffset, length);
2083 } else if (element is ParameterElementImpl) { 2084 } else if (element is ParameterElementImpl) {
2084 cache.remove(element); 2085 cache.remove(element);
2085 element.setVisibleRange(newOffset, length); 2086 element.setVisibleRange(newOffset, length);
2086 } 2087 }
2087 } 2088 }
2088 } 2089 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 @override 2161 @override
2161 String toString() => name; 2162 String toString() => name;
2162 } 2163 }
2163 2164
2164 class _TokenPair { 2165 class _TokenPair {
2165 final _TokenDifferenceKind kind; 2166 final _TokenDifferenceKind kind;
2166 final Token oldToken; 2167 final Token oldToken;
2167 final Token newToken; 2168 final Token newToken;
2168 _TokenPair(this.kind, this.oldToken, this.newToken); 2169 _TokenPair(this.kind, this.oldToken, this.newToken);
2169 } 2170 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698