| Index: pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| index 2fcc8c3d0150088383cac95dc870b6375185cd13..84eeeac1a476b25350b5bdecc42563b47b4c9f8d 100644
|
| --- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| +++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| @@ -236,6 +236,7 @@ class AssistProcessor {
|
| String typeSource;
|
| DartType type = declaredIdentifier.identifier.bestType;
|
| if (type is InterfaceType || type is FunctionType) {
|
| + _configureTargetLocation(node);
|
| Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
|
| typeSource = utils.getTypeSource(type, librariesToImport);
|
| _addLibraryImports(librariesToImport);
|
| @@ -290,6 +291,7 @@ class AssistProcessor {
|
| // prepare type source
|
| String typeSource;
|
| if (type is InterfaceType || type is FunctionType) {
|
| + _configureTargetLocation(node);
|
| Set<LibraryElement> librariesToImport = new Set<LibraryElement>();
|
| typeSource = utils.getTypeSource(type, librariesToImport);
|
| _addLibraryImports(librariesToImport);
|
| @@ -1623,6 +1625,20 @@ class AssistProcessor {
|
| }
|
|
|
| /**
|
| + * Configures [utils] using given [target].
|
| + */
|
| + void _configureTargetLocation(Object target) {
|
| + utils.targetClassElement = null;
|
| + if (target is AstNode) {
|
| + ClassDeclaration targetClassDeclaration =
|
| + target.getAncestor((node) => node is ClassDeclaration);
|
| + if (targetClassDeclaration != null) {
|
| + utils.targetClassElement = targetClassDeclaration.element;
|
| + }
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Returns an existing or just added [LinkedEditGroup] with [groupId].
|
| */
|
| LinkedEditGroup _getLinkedPosition(String groupId) {
|
|
|