| Index: pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| index c032211ab62bd59f0d1e03df5a2fcaadc1386760..6110a25c9bd46d28c1f4b2cd74f1be152002a5fd 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| @@ -69,6 +69,11 @@ class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> {
|
| }
|
|
|
| @override
|
| + Future<bool> visitExpression(Expression node) {
|
| + return _addImportedElementSuggestions();
|
| + }
|
| +
|
| + @override
|
| Future<bool> visitExpressionStatement(ExpressionStatement node) {
|
| Expression expression = node.expression;
|
| // A pre-variable declaration (e.g. C ^) is parsed as an expression
|
| @@ -88,7 +93,19 @@ class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> {
|
| Future<bool> visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| // Make suggestions for the prefix, but not for the selector
|
| // InvocationComputer makes selector suggestions
|
| - if (request.offset <= node.prefix.end) {
|
| + Token period = node.period;
|
| + if (period != null && request.offset <= period.offset) {
|
| + return _addImportedElementSuggestions();
|
| + }
|
| + return new Future.value(false);
|
| + }
|
| +
|
| + @override
|
| + Future<bool> visitPropertyAccess(PropertyAccess node) {
|
| + // Make suggestions for the target, but not for the property name
|
| + // InvocationComputer makes property name suggestions
|
| + var operator = node.operator;
|
| + if (operator != null && request.offset < operator.offset) {
|
| return _addImportedElementSuggestions();
|
| }
|
| return new Future.value(false);
|
| @@ -100,6 +117,11 @@ class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> {
|
| }
|
|
|
| @override
|
| + Future<bool> visitStringLiteral(StringLiteral node) {
|
| + return new Future.value(false);
|
| + }
|
| +
|
| + @override
|
| Future<bool> visitTypeName(TypeName node) {
|
| return _addImportedElementSuggestions(typesOnly: true);
|
| }
|
|
|