Remove DartCompletionRequest, use what was Impl instead.
I think we don't expect that users will write plugins that use these types. So, we can remove the indirection. Similarly, CompletionRequest is also currently de-facto a Dart completion request, because it has `ResolvedUnitResult result`. I will fold it into DartCompletionRequest in a future CL. Change-Id: I2ea1d443ae18535f8c72f785dd1b91cf8d30ffa7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218021 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
@@ -32,7 +32,7 @@ class CiderCompletionComputer {
|
||||
final OperationPerformanceImpl _performanceRoot =
|
||||
OperationPerformanceImpl('<root>');
|
||||
|
||||
late DartCompletionRequestImpl _dartCompletionRequest;
|
||||
late DartCompletionRequest _dartCompletionRequest;
|
||||
|
||||
/// Paths of imported libraries for which suggestions were (re)computed
|
||||
/// during processing of this request. Does not include libraries that were
|
||||
@@ -78,7 +78,7 @@ class CiderCompletionComputer {
|
||||
CompletionPerformance(),
|
||||
);
|
||||
|
||||
_dartCompletionRequest = DartCompletionRequestImpl.from(
|
||||
_dartCompletionRequest = DartCompletionRequest.from(
|
||||
completionRequest,
|
||||
);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class CompletionDomainHandler extends AbstractRequestHandler {
|
||||
|
||||
var contributorTag = 'computeSuggestions - ${manager.runtimeType}';
|
||||
await perf.runAsync(contributorTag, (performance) async {
|
||||
var dartRequest = DartCompletionRequestImpl.from(
|
||||
var dartRequest = DartCompletionRequest.from(
|
||||
request,
|
||||
dartdocDirectiveInfo: server.getDartdocDirectiveInfoFor(
|
||||
request.result,
|
||||
|
||||
@@ -76,7 +76,7 @@ class RuntimeCompletionComputer {
|
||||
CompletionPerformance(),
|
||||
);
|
||||
|
||||
var dartRequest = DartCompletionRequestImpl.from(request);
|
||||
var dartRequest = DartCompletionRequest.from(request);
|
||||
|
||||
var suggestions = await request.performance.runRequestOperation(
|
||||
(performance) async {
|
||||
|
||||
@@ -213,7 +213,7 @@ class CompletionHandler
|
||||
CompletionRequestImpl(unit, offset, performance);
|
||||
final directiveInfo =
|
||||
server.getDartdocDirectiveInfoFor(completionRequest.result);
|
||||
final dartCompletionRequest = DartCompletionRequestImpl.from(
|
||||
final dartCompletionRequest = DartCompletionRequest.from(
|
||||
completionRequest,
|
||||
dartdocDirectiveInfo: directiveInfo,
|
||||
completionPreference: CompletionPreference.replace,
|
||||
|
||||
@@ -2,17 +2,8 @@
|
||||
// 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:analysis_server/src/provisional/completion/completion_core.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/feature_computer.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/analysis/features.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
|
||||
import 'package:analyzer/src/generated/source.dart';
|
||||
import 'package:analyzer_plugin/src/utilities/completion/completion_target.dart';
|
||||
import 'package:analyzer_plugin/src/utilities/completion/optype.dart';
|
||||
|
||||
export 'package:analyzer_plugin/utilities/completion/relevance.dart';
|
||||
|
||||
@@ -28,64 +19,3 @@ abstract class DartCompletionContributor {
|
||||
/// given completion [request] have been added to the [builder].
|
||||
Future<void> computeSuggestions();
|
||||
}
|
||||
|
||||
/// The information about a requested list of completions within a Dart file.
|
||||
///
|
||||
/// Clients may not extend, implement or mix-in this class.
|
||||
abstract class DartCompletionRequest extends CompletionRequest {
|
||||
CompletionPreference get completionPreference;
|
||||
|
||||
/// Return the type imposed on the target's `containingNode` based on its
|
||||
/// context, or `null` if the context does not impose any type.
|
||||
DartType? get contextType;
|
||||
|
||||
/// Return the object used to resolve macros in Dartdoc comments.
|
||||
DartdocDirectiveInfo get dartdocDirectiveInfo;
|
||||
|
||||
/// Return the expression to the right of the "dot" or "dot dot",
|
||||
/// or `null` if this is not a "dot" completion (e.g. `foo.b`).
|
||||
Expression? get dotTarget;
|
||||
|
||||
/// Return the object used to compute the values of the features used to
|
||||
/// compute relevance scores for suggestions.
|
||||
FeatureComputer get featureComputer;
|
||||
|
||||
/// Return the feature set that was used to analyze the compilation unit in
|
||||
/// which suggestions are being made.
|
||||
FeatureSet get featureSet;
|
||||
|
||||
/// Return `true` if free standing identifiers should be suggested
|
||||
bool get includeIdentifiers;
|
||||
|
||||
/// Return `true` if the completion is occurring in a constant context.
|
||||
bool get inConstantContext;
|
||||
|
||||
/// Return the library element which contains the unit in which the completion
|
||||
/// is occurring.
|
||||
LibraryElement get libraryElement;
|
||||
|
||||
/// Answer the [DartType] for Object in dart:core
|
||||
DartType get objectType;
|
||||
|
||||
/// The [OpType] which describes which types of suggestions would fit the
|
||||
/// request.
|
||||
OpType get opType;
|
||||
|
||||
/// The source range that represents the region of text that should be
|
||||
/// replaced when a suggestion is selected.
|
||||
SourceRange get replacementRange;
|
||||
|
||||
/// Return the [SourceFactory] of the request.
|
||||
SourceFactory get sourceFactory;
|
||||
|
||||
/// Return the completion target. This determines what part of the parse tree
|
||||
/// will receive the newly inserted text.
|
||||
/// At a minimum, all declarations in the completion scope in [target.unit]
|
||||
/// will be resolved if they can be resolved.
|
||||
CompletionTarget get target;
|
||||
|
||||
/// Return prefix that already exists in the document for [target] or empty
|
||||
/// string if unavailable. This can be used to filter the completion list to
|
||||
/// items that already match the text to the left of the caret.
|
||||
String get targetPrefix;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/completion_core.dart';
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/utilities/flutter.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:analysis_server/src/protocol_server.dart'
|
||||
hide Element, ElementKind;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class DartCompletionManager {
|
||||
includedSuggestionRelevanceTags == null));
|
||||
|
||||
Future<List<CompletionSuggestion>> computeSuggestions(
|
||||
DartCompletionRequestImpl dartRequest,
|
||||
DartCompletionRequest dartRequest,
|
||||
OperationPerformanceImpl performance, {
|
||||
bool enableOverrideContributor = true,
|
||||
bool enableUriContributor = true,
|
||||
@@ -159,7 +159,7 @@ class DartCompletionManager {
|
||||
return builder.suggestions.toList();
|
||||
}
|
||||
|
||||
void _addIncludedElementKinds(DartCompletionRequestImpl request) {
|
||||
void _addIncludedElementKinds(DartCompletionRequest request) {
|
||||
var opType = request.opType;
|
||||
|
||||
if (!opType.includeIdentifiers) return;
|
||||
@@ -192,7 +192,7 @@ class DartCompletionManager {
|
||||
}
|
||||
}
|
||||
|
||||
void _addIncludedSuggestionRelevanceTags(DartCompletionRequestImpl request) {
|
||||
void _addIncludedSuggestionRelevanceTags(DartCompletionRequest request) {
|
||||
final includedSuggestionRelevanceTags =
|
||||
this.includedSuggestionRelevanceTags!;
|
||||
var location = request.opType.completionLocation;
|
||||
@@ -243,31 +243,35 @@ class DartCompletionManager {
|
||||
}
|
||||
|
||||
/// The information about a requested list of completions within a Dart file.
|
||||
class DartCompletionRequestImpl implements DartCompletionRequest {
|
||||
@override
|
||||
class DartCompletionRequest implements CompletionRequest {
|
||||
final CompletionPreference completionPreference;
|
||||
|
||||
@override
|
||||
/// Return the type imposed on the target's `containingNode` based on its
|
||||
/// context, or `null` if the context does not impose any type.
|
||||
final DartType? contextType;
|
||||
|
||||
@override
|
||||
/// Return the object used to resolve macros in Dartdoc comments.
|
||||
final DartdocDirectiveInfo dartdocDirectiveInfo;
|
||||
|
||||
final DocumentationCache? documentationCache;
|
||||
|
||||
@override
|
||||
/// Return the expression to the right of the "dot" or "dot dot",
|
||||
/// or `null` if this is not a "dot" completion (e.g. `foo.b`).
|
||||
final Expression? dotTarget;
|
||||
|
||||
@override
|
||||
/// Return the object used to compute the values of the features used to
|
||||
/// compute relevance scores for suggestions.
|
||||
final FeatureComputer featureComputer;
|
||||
|
||||
@override
|
||||
final int offset;
|
||||
|
||||
@override
|
||||
/// The [OpType] which describes which types of suggestions would fit the
|
||||
/// request.
|
||||
final OpType opType;
|
||||
|
||||
@override
|
||||
/// The source range that represents the region of text that should be
|
||||
/// replaced when a suggestion is selected.
|
||||
final SourceRange replacementRange;
|
||||
|
||||
final CompletionRequest request;
|
||||
@@ -278,10 +282,13 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
|
||||
@override
|
||||
final Source source;
|
||||
|
||||
@override
|
||||
/// Return the completion target. This determines what part of the parse tree
|
||||
/// will receive the newly inserted text.
|
||||
/// At a minimum, all declarations in the completion scope in [target.unit]
|
||||
/// will be resolved if they can be resolved.
|
||||
final CompletionTarget target;
|
||||
|
||||
DartCompletionRequestImpl._({
|
||||
DartCompletionRequest._({
|
||||
required this.completionPreference,
|
||||
required this.contextType,
|
||||
required this.dartdocDirectiveInfo,
|
||||
@@ -297,24 +304,26 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
|
||||
required this.target,
|
||||
});
|
||||
|
||||
@override
|
||||
/// Return the feature set that was used to analyze the compilation unit in
|
||||
/// which suggestions are being made.
|
||||
FeatureSet get featureSet => libraryElement.featureSet;
|
||||
|
||||
@override
|
||||
/// Return `true` if free standing identifiers should be suggested
|
||||
bool get includeIdentifiers {
|
||||
return opType.includeIdentifiers;
|
||||
}
|
||||
|
||||
@override
|
||||
/// Return `true` if the completion is occurring in a constant context.
|
||||
bool get inConstantContext {
|
||||
var entity = target.entity;
|
||||
return entity is Expression && entity.inConstantContext;
|
||||
}
|
||||
|
||||
@override
|
||||
/// Return the library element which contains the unit in which the completion
|
||||
/// is occurring.
|
||||
LibraryElement get libraryElement => result.libraryElement;
|
||||
|
||||
@override
|
||||
/// Answer the [DartType] for Object in dart:core
|
||||
DartType get objectType => libraryElement.typeProvider.objectType;
|
||||
|
||||
@override
|
||||
@@ -323,13 +332,15 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
|
||||
@override
|
||||
String? get sourceContents => result.content;
|
||||
|
||||
@override
|
||||
/// Return the [SourceFactory] of the request.
|
||||
SourceFactory get sourceFactory {
|
||||
var context = result.session.analysisContext as DriverBasedAnalysisContext;
|
||||
return context.driver.sourceFactory;
|
||||
}
|
||||
|
||||
@override
|
||||
/// Return prefix that already exists in the document for [target] or empty
|
||||
/// string if unavailable. This can be used to filter the completion list to
|
||||
/// items that already match the text to the left of the caret.
|
||||
String get targetPrefix {
|
||||
var entity = target.entity;
|
||||
|
||||
@@ -364,7 +375,7 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
|
||||
/// Return a newly created completion request based on the given [request].
|
||||
/// This method will throw [AbortCompletion] if the completion request has
|
||||
/// been aborted.
|
||||
static DartCompletionRequestImpl from(
|
||||
static DartCompletionRequest from(
|
||||
CompletionRequest request, {
|
||||
DartdocDirectiveInfo? dartdocDirectiveInfo,
|
||||
CompletionPreference completionPreference = CompletionPreference.insert,
|
||||
@@ -393,7 +404,7 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
|
||||
opType.includeVoidReturnSuggestions = true;
|
||||
}
|
||||
|
||||
return DartCompletionRequestImpl._(
|
||||
return DartCompletionRequest._(
|
||||
completionPreference: completionPreference,
|
||||
contextType: contextType,
|
||||
dartdocDirectiveInfo: dartdocDirectiveInfo ?? DartdocDirectiveInfo(),
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:analysis_server/src/protocol_server.dart'
|
||||
show CompletionSuggestionKind;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/utilities/extensions/element.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
|
||||
+1
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart'
|
||||
show SuggestionBuilder;
|
||||
|
||||
@@ -56,10 +56,8 @@ class _KeywordVisitor extends GeneralizingAstVisitor<void> {
|
||||
|
||||
@override
|
||||
void visitArgumentList(ArgumentList node) {
|
||||
if (request is DartCompletionRequestImpl) {
|
||||
if (request.opType.includeOnlyNamedArgumentSuggestions) {
|
||||
return;
|
||||
}
|
||||
if (request.opType.includeOnlyNamedArgumentSuggestions) {
|
||||
return;
|
||||
}
|
||||
final entity = this.entity;
|
||||
if (entity == node.rightParenthesis) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart'
|
||||
show DartCompletionRequestImpl;
|
||||
show DartCompletionRequest;
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer_plugin/src/utilities/visitors/local_declaration_visitor.dart'
|
||||
@@ -21,7 +21,7 @@ class LabelContributor extends DartCompletionContributor {
|
||||
|
||||
@override
|
||||
Future<void> computeSuggestions() async {
|
||||
var optype = (request as DartCompletionRequestImpl).opType;
|
||||
var optype = request.opType;
|
||||
|
||||
// Collect suggestions from the specific child [AstNode] that contains
|
||||
// the completion offset and all of its parents recursively.
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:analysis_server/src/protocol_server.dart'
|
||||
show CompletionSuggestionKind;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
|
||||
/// A contributor that produces suggestions based on the prefixes defined on
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:analysis_server/src/protocol_server.dart'
|
||||
show CompletionSuggestionKind;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart'
|
||||
show SuggestionBuilder;
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'package:analysis_server/src/protocol_server.dart'
|
||||
show CompletionSuggestionKind;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/protocol_server.dart' as protocol;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/utilities/extensions/completion_request.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/utilities/extensions/completion_request.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
@@ -1177,15 +1177,12 @@ class SuggestionBuilder {
|
||||
/// If the [element] has a documentation comment, fill the [suggestion]'s
|
||||
/// documentation fields.
|
||||
void _setDocumentation(CompletionSuggestion suggestion, Element element) {
|
||||
final request = this.request;
|
||||
if (request is DartCompletionRequestImpl) {
|
||||
var documentationCache = request.documentationCache;
|
||||
var data = documentationCache?.dataFor(element);
|
||||
if (data != null) {
|
||||
suggestion.docComplete = data.full;
|
||||
suggestion.docSummary = data.summary;
|
||||
return;
|
||||
}
|
||||
var documentationCache = request.documentationCache;
|
||||
var data = documentationCache?.dataFor(element);
|
||||
if (data != null) {
|
||||
suggestion.docComplete = data.full;
|
||||
suggestion.docSummary = data.summary;
|
||||
return;
|
||||
}
|
||||
var doc = DartUnitHoverComputer.computeDocumentation(
|
||||
request.dartdocDirectiveInfo, element,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/ast/visitor.dart';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/// A collection of utility methods used by completion contributors.
|
||||
import 'package:analysis_server/src/protocol_server.dart'
|
||||
show CompletionSuggestion, Location;
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/ast/standard_ast_factory.dart';
|
||||
import 'package:analyzer/dart/ast/token.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/services/correction/name_suggestion.dart';
|
||||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// 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:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analyzer/dart/analysis/features.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/nullability_suffix.dart';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/arglist_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/src/dart/analysis/experiments.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/combinator_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:test_reflective_loader/test_reflective_loader.dart';
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
|
||||
import 'package:analysis_server/src/services/completion/completion_core.dart';
|
||||
import 'package:analysis_server/src/services/completion/completion_performance.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart'
|
||||
show DartCompletionRequestImpl;
|
||||
show DartCompletionRequest;
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/utilities.dart';
|
||||
import 'package:analyzer/dart/analysis/results.dart';
|
||||
@@ -537,7 +537,7 @@ abstract class _BaseDartCompletionContributorTest extends AbstractContextTest {
|
||||
return await baseRequest.performance.runRequestOperation(
|
||||
(performance) async {
|
||||
// Build the request
|
||||
var request = DartCompletionRequestImpl.from(
|
||||
var request = DartCompletionRequest.from(
|
||||
baseRequest,
|
||||
dartdocDirectiveInfo: dartdocInfo,
|
||||
);
|
||||
|
||||
@@ -57,7 +57,7 @@ part 'test.dart';
|
||||
completionOffset,
|
||||
CompletionPerformance());
|
||||
await baseRequest.performance.runRequestOperation((performance) async {
|
||||
request = DartCompletionRequestImpl.from(baseRequest);
|
||||
request = DartCompletionRequest.from(baseRequest);
|
||||
});
|
||||
|
||||
var directives = request.target.unit.directives;
|
||||
|
||||
+1
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/extension_member_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test_reflective_loader/test_reflective_loader.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/field_formal_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/protocol_server.dart';
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/src/dart/analysis/experiments.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/keyword_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer/dart/analysis/features.dart';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/protocol_server.dart';
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/label_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/library_member_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/protocol_server.dart';
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/library_prefix_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:analysis_server/src/protocol_server.dart';
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/local_reference_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
+1
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/named_constructor_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/override_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/static_member_contributor.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/type_member_contributor.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/uri_contributor.dart';
|
||||
import 'package:analyzer/file_system/memory_file_system.dart';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
|
||||
import 'package:analysis_server/src/services/completion/dart/variable_name_contributor.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -29,7 +29,7 @@ class ContextTypeTest extends AbstractSingleUnitTest {
|
||||
}
|
||||
|
||||
Future<CompletionSuggestion> forTopLevelFunction(String functionName) async {
|
||||
var request = DartCompletionRequestImpl.from(
|
||||
var request = DartCompletionRequest.from(
|
||||
CompletionRequestImpl(testAnalysisResult, 0, CompletionPerformance()),
|
||||
);
|
||||
var builder = SuggestionBuilder(request);
|
||||
|
||||
@@ -100,7 +100,7 @@ class CompletionRunner {
|
||||
|
||||
timer.start();
|
||||
var request = CompletionRequestImpl(result, offset, statistics);
|
||||
var dartRequest = DartCompletionRequestImpl.from(request);
|
||||
var dartRequest = DartCompletionRequest.from(request);
|
||||
var suggestions = await request.performance.runRequestOperation(
|
||||
(performance) async {
|
||||
return await contributor.computeSuggestions(
|
||||
|
||||
@@ -1208,7 +1208,7 @@ class CompletionMetricsComputer {
|
||||
availableSuggestionsParams]) async {
|
||||
List<protocol.CompletionSuggestion> suggestions;
|
||||
|
||||
var dartRequest = DartCompletionRequestImpl.from(
|
||||
var dartRequest = DartCompletionRequest.from(
|
||||
request,
|
||||
dartdocDirectiveInfo: dartdocDirectiveInfo,
|
||||
documentationCache: documentationCache,
|
||||
@@ -1385,7 +1385,7 @@ class CompletionMetricsComputer {
|
||||
late List<protocol.CompletionSuggestion> suggestions;
|
||||
await request.performance.runRequestOperation(
|
||||
(performance) async {
|
||||
var dartRequest = DartCompletionRequestImpl.from(
|
||||
var dartRequest = DartCompletionRequest.from(
|
||||
request,
|
||||
documentationCache: documentationCache,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user