Index: pkg/analysis_server/lib/src/services/refactoring/rename.dart |
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename.dart b/pkg/analysis_server/lib/src/services/refactoring/rename.dart |
index ec36d008a7ece0f066fb47cc848f61771fe90cf5..b6f54c12b78c879c0e0716c406d717453d3aa6d9 100644 |
--- a/pkg/analysis_server/lib/src/services/refactoring/rename.dart |
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename.dart |
@@ -98,7 +98,7 @@ bool isReferenceInLocalRange(LocalElement localElement, SearchMatch reference) { |
return false; |
} |
Source localSource = localElement.source; |
- Source referenceSource = reference.element.source; |
+ Source referenceSource = reference.unitSource; |
SourceRange localRange = localElement.visibleRange; |
SourceRange referenceRange = reference.sourceRange; |
return referenceSource == localSource && |