| 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 a69dbb14a5705f7521fa8bd6b41baf7bbf301183..e6bb3282603aa42b065c3da5178505f88b2e28fc 100644
|
| --- a/pkg/analysis_server/lib/src/domain_completion.dart
|
| +++ b/pkg/analysis_server/lib/src/domain_completion.dart
|
| @@ -89,8 +89,8 @@ class CompletionDomainHandler implements RequestHandler {
|
| * Return the [CompletionManager] for the given [context] and [source],
|
| * creating a new manager or returning an existing manager as necessary.
|
| */
|
| - CompletionManager completionManagerFor(AnalysisContext context,
|
| - Source source) {
|
| + CompletionManager completionManagerFor(
|
| + AnalysisContext context, Source source) {
|
| if (_manager != null) {
|
| if (_manager.context == context && _manager.source == source) {
|
| return _manager;
|
| @@ -118,8 +118,8 @@ class CompletionDomainHandler implements RequestHandler {
|
| }
|
| }
|
|
|
| - CompletionManager createCompletionManager(AnalysisContext context,
|
| - Source source, SearchEngine searchEngine) {
|
| + CompletionManager createCompletionManager(
|
| + AnalysisContext context, Source source, SearchEngine searchEngine) {
|
| return new CompletionManager.create(context, source, searchEngine);
|
| }
|
|
|
| @@ -186,12 +186,8 @@ class CompletionDomainHandler implements RequestHandler {
|
| manager.results(completionRequest).listen((CompletionResult result) {
|
| ++notificationCount;
|
| performance.logElapseTime("notification $notificationCount send", () {
|
| - sendCompletionNotification(
|
| - completionId,
|
| - result.replacementOffset,
|
| - result.replacementLength,
|
| - result.suggestions,
|
| - result.last);
|
| + sendCompletionNotification(completionId, result.replacementOffset,
|
| + result.replacementLength, result.suggestions, result.last);
|
| });
|
| if (notificationCount == 1) {
|
| performance.logFirstNotificationComplete('notification 1 complete');
|
| @@ -204,8 +200,8 @@ class CompletionDomainHandler implements RequestHandler {
|
| }
|
| });
|
| // initial response without results
|
| - return new CompletionGetSuggestionsResult(
|
| - completionId).toResponse(request.id);
|
| + return new CompletionGetSuggestionsResult(completionId)
|
| + .toResponse(request.id);
|
| }
|
|
|
| /**
|
| @@ -233,14 +229,11 @@ class CompletionDomainHandler implements RequestHandler {
|
| * Send completion notification results.
|
| */
|
| void sendCompletionNotification(String completionId, int replacementOffset,
|
| - int replacementLength, Iterable<CompletionSuggestion> results, bool isLast) {
|
| - server.sendNotification(
|
| - new CompletionResultsParams(
|
| - completionId,
|
| - replacementOffset,
|
| - replacementLength,
|
| - results,
|
| - isLast).toNotification());
|
| + int replacementLength, Iterable<CompletionSuggestion> results,
|
| + bool isLast) {
|
| + server.sendNotification(new CompletionResultsParams(
|
| + completionId, replacementOffset, replacementLength, results, isLast)
|
| + .toNotification());
|
| }
|
|
|
| /**
|
| @@ -248,7 +241,6 @@ class CompletionDomainHandler implements RequestHandler {
|
| * the cache changes or if any source is added, removed, or deleted.
|
| */
|
| void sourcesChanged(SourcesChangedEvent event) {
|
| -
|
| bool shouldDiscardManager(SourcesChangedEvent event) {
|
| if (_manager == null) {
|
| return false;
|
| @@ -258,7 +250,8 @@ class CompletionDomainHandler implements RequestHandler {
|
| }
|
| var changedSources = event.changedSources;
|
| return changedSources.length > 2 ||
|
| - (changedSources.length == 1 && !changedSources.contains(_manager.source));
|
| + (changedSources.length == 1 &&
|
| + !changedSources.contains(_manager.source));
|
| }
|
|
|
| if (shouldDiscardManager(event)) {
|
|
|