| Index: pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
|
| index 574931b90149738f5d7565e4991c0c2df7d3030a..65ed8df54cd6fe49303a8dc6ab303de8da5ed520 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
|
| @@ -49,6 +49,20 @@ class _ImportUriSuggestionBuilder extends SimpleAstVisitor {
|
| }
|
|
|
| @override
|
| + visitImportDirective(ImportDirective node) {
|
| + StringLiteral uri = node.uri;
|
| + if (uri is SimpleStringLiteral) {
|
| + int offset = request.offset;
|
| + if (uri.offset < offset &&
|
| + (offset < uri.end || offset == uri.offset + 1)) {
|
| + // Handle degenerate case where import is only line in file
|
| + // and there is no semicolon
|
| + visitSimpleStringLiteral(uri);
|
| + }
|
| + }
|
| + }
|
| +
|
| + @override
|
| visitSimpleStringLiteral(SimpleStringLiteral node) {
|
| AstNode parent = node.parent;
|
| if (parent is ImportDirective && parent.uri == node) {
|
|
|