Files
sdk/pkg/analyzer_plugin/lib/utilities/completion/suggestion_builder.dart
T
Paul Berry e2f77056a5 Eliminate dependencies on pkg/front_end.
The API for pkg/front_end is still in flux so we want to avoid having
any packages depend directly on it (other than analyzer and
back-ends).

This CL re-exports some of the critical pieces of front_end needed by
analyzer clients so that those clients can access them via analyzer,
without having to directly depend on front_end.  It also updates
pkg/analyzer_plugin to make use of those re-exports.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2993123002 .
2017-08-07 09:46:30 -07:00

26 lines
1.1 KiB
Dart

// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element;
import 'package:analyzer_plugin/utilities/completion/relevance.dart';
import 'package:analyzer/src/generated/source.dart' show Source;
/**
* An object used to build code completion suggestions for Dart code.
*/
abstract class SuggestionBuilder {
/**
* Return a suggestion based on the given [element], or `null` if a suggestion
* is not appropriate for the given element. If the suggestion is not
* currently in scope, then specify [importForSource] as the source to which
* an import should be added.
*/
CompletionSuggestion forElement(Element element,
{String completion,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
int relevance: DART_RELEVANCE_DEFAULT,
Source importForSource});
}