Index: pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart |
diff --git a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart |
index 816894d639106146447ccdb805d7928ecb3b8e0d..faf56be56b57495ebfb7eba394d4483d3d62697c 100644 |
--- a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart |
+++ b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart |
@@ -10,6 +10,7 @@ import 'package:analysis_server/plugin/protocol/protocol.dart'; |
import 'package:analysis_server/src/provisional/completion/completion_core.dart'; |
import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart'; |
import 'package:analyzer/src/generated/ast.dart'; |
+import 'package:analyzer/src/generated/element.dart'; |
export 'package:analysis_server/src/provisional/completion/completion_core.dart' |
show EMPTY_LIST; |
@@ -60,6 +61,16 @@ abstract class DartCompletionContributor { |
*/ |
abstract class DartCompletionRequest extends CompletionRequest { |
/** |
+ * Return a [Future] that completes with the library element |
+ * which contains the unit in which the completion is occurring. |
+ * The [Future] may return `null` if the library cannot be determined |
+ * (e.g. unlinked part file). |
+ * Any information obtained from [target] prior to calling this method |
+ * should be discarded as it may have changed. |
+ */ |
+ Future<LibraryElement> get libraryElement; |
+ |
+ /** |
* Return the completion target. This determines what part of the parse tree |
* will receive the newly inserted text. |
*/ |