| Index: pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| index 3883df31e1d53d1b68e975bdd4774fb3e531459b..0fbbaafd683afcbe55167973fa993e9be4e40eee 100644
|
| --- a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| +++ b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
|
| @@ -200,7 +200,7 @@ class InlineMethodRefactoringImpl extends RefactoringImpl
|
| final AstProvider astProvider;
|
| final CompilationUnit unit;
|
| final int offset;
|
| - _UnitCache _unitCache;
|
| + ResolvedUnitCache _unitCache;
|
| CorrectionUtils utils;
|
| SourceChange change;
|
|
|
| @@ -223,7 +223,7 @@ class InlineMethodRefactoringImpl extends RefactoringImpl
|
|
|
| InlineMethodRefactoringImpl(
|
| this.searchEngine, this.astProvider, this.unit, this.offset) {
|
| - _unitCache = new _UnitCache(astProvider, unit);
|
| + _unitCache = new ResolvedUnitCache(astProvider, unit);
|
| utils = new CorrectionUtils(unit);
|
| }
|
|
|
| @@ -789,26 +789,6 @@ class _SourcePart {
|
| }
|
| }
|
|
|
| -class _UnitCache {
|
| - final AstProvider astProvider;
|
| - final Map<CompilationUnitElement, CompilationUnit> map = {};
|
| -
|
| - _UnitCache(this.astProvider, CompilationUnit unit) {
|
| - map[unit.element] = unit;
|
| - }
|
| -
|
| - Future<CompilationUnit> getUnit(Element element) async {
|
| - Element unitElement =
|
| - element.getAncestor((e) => e is CompilationUnitElement);
|
| - CompilationUnit unit = map[unitElement];
|
| - if (unit == null) {
|
| - unit = await astProvider.getResolvedUnitForElement(element);
|
| - map[unitElement] = unit;
|
| - }
|
| - return unit;
|
| - }
|
| -}
|
| -
|
| /**
|
| * A visitor that fills [_SourcePart] with fields, parameters and variables.
|
| */
|
|
|