Chromium Code Reviews| Index: pkg/analysis_server/lib/src/domain_completion.dart |
| diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart |
| index a00617f22f630dbfa41cec09a5e82fe4a60abbf3..7bd146f599da4bd26c14d33b6f18290881fb0acb 100644 |
| --- a/pkg/analysis_server/lib/src/domain_completion.dart |
| +++ b/pkg/analysis_server/lib/src/domain_completion.dart |
| @@ -121,6 +121,16 @@ class CompletionDomainHandler extends AbstractRequestHandler { |
| for (plugin.Response response in responses) { |
| plugin.CompletionGetSuggestionsResult result = |
| new plugin.CompletionGetSuggestionsResult.fromResponse(response); |
| + if (suggestions.isEmpty) { |
| + request.replacementOffset = result.replacementOffset; |
| + request.replacementLength = result.replacementLength; |
|
Brian Wilkerson
2017/05/30 18:30:22
I think we only want to overwrite the current valu
maxkim
2017/05/30 19:10:32
Adding the null-aware assignment is making the rep
Brian Wilkerson
2017/05/30 19:18:48
I'm probably just being too cautious. I'm willing
|
| + } else if (request.replacementOffset != result.replacementOffset && |
| + request.replacementLength != result.replacementLength) { |
| + server.instrumentationService |
| + .logError('Plugin completion-results dropped due to conflicting' |
| + ' replacement offset/length: ${result.toJson()}'); |
| + continue; |
| + } |
| suggestions.addAll(result.results); |
| } |
| } |