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

Unified Diff: pkg/analyzer/lib/src/dart/element/builder.dart

Issue 1690783002: Set visible ranges for local variables/functions to the ranges of enclosing blocks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/dart/element/builder.dart
diff --git a/pkg/analyzer/lib/src/dart/element/builder.dart b/pkg/analyzer/lib/src/dart/element/builder.dart
index 7422233465ae7f4530f126c6e9d61609765ddc5d..ac051b984a1e07ab85da83e46c0e06dc336adfc5 100644
--- a/pkg/analyzer/lib/src/dart/element/builder.dart
+++ b/pkg/analyzer/lib/src/dart/element/builder.dart
@@ -695,9 +695,7 @@ class ElementBuilder extends RecursiveAstVisitor<Object> {
if (_inFunction) {
Block enclosingBlock = node.getAncestor((node) => node is Block);
if (enclosingBlock != null) {
- int functionEnd = node.offset + node.length;
- int blockEnd = enclosingBlock.offset + enclosingBlock.length;
- element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
+ element.setVisibleRange(enclosingBlock.offset, enclosingBlock.length);
}
}
if (node.returnType == null) {
@@ -816,9 +814,7 @@ class ElementBuilder extends RecursiveAstVisitor<Object> {
if (_inFunction) {
Block enclosingBlock = node.getAncestor((node) => node is Block);
if (enclosingBlock != null) {
- int functionEnd = node.offset + node.length;
- int blockEnd = enclosingBlock.offset + enclosingBlock.length;
- element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
+ element.setVisibleRange(enclosingBlock.offset, enclosingBlock.length);
}
}
if (_functionTypesToFix != null) {
« pkg/analyzer/lib/dart/element/element.dart ('K') | « pkg/analyzer/lib/dart/element/element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698