Remove the remaining unnecessary awaits from analysis_server

Change-Id: I3d10c244ca711a0978cb2d4a99dbe1f3bedc159c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144863
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Brian Wilkerson 2020-04-27 04:05:59 +00:00 committed by commit-bot@chromium.org
parent f43437cf80
commit c1edd26d97
24 changed files with 0 additions and 162 deletions

View file

@ -597,8 +597,6 @@ class AnalysisServer extends AbstractAnalysisServer {
}
Future<void> _scheduleAnalysisImplementedNotification() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var files = analysisServices[AnalysisService.IMPLEMENTED];
if (files != null) {
scheduleImplementedNotification(this, files);

View file

@ -299,8 +299,6 @@ abstract class AbstractAnalysisServer implements DriverProvider {
/// [offset] of the given [file], or with `null` if there is no node at the
/// [offset] or the node does not have an element.
Future<Element> getElementAtOffset(String file, int offset) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
if (!priorityFiles.contains(file)) {
var driver = getAnalysisDriver(file);
if (driver == null) {
@ -348,8 +346,6 @@ abstract class AbstractAnalysisServer implements DriverProvider {
/// given [offset] of the given [file], or with `null` if there is no node as
/// the [offset].
Future<AstNode> getNodeAtOffset(String file, int offset) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = await getResolvedUnit(file);
var unit = result?.unit;
if (unit != null) {

View file

@ -43,8 +43,6 @@ mixin RequestHandlerMixin<T extends AbstractAnalysisServer> {
Map<PluginInfo, Future<plugin.Response>> futures,
{plugin.RequestParams requestParameters,
int timeout = 500}) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// TODO(brianwilkerson) requestParameters might need to be required.
var endTime = DateTime.now().millisecondsSinceEpoch + timeout;
var responses = <plugin.Response>[];

View file

@ -57,8 +57,6 @@ class AnalysisDomainHandler extends AbstractRequestHandler {
/// Implement the `analysis.getHover` request.
Future<void> getHover(Request request) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var params = AnalysisGetHoverParams.fromRequest(request);
var file = params.file;
@ -87,8 +85,6 @@ class AnalysisDomainHandler extends AbstractRequestHandler {
/// Implement the `analysis.getImportedElements` request.
Future<void> getImportedElements(Request request) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var params = AnalysisGetImportedElementsParams.fromRequest(request);
var file = params.file;
@ -147,8 +143,6 @@ class AnalysisDomainHandler extends AbstractRequestHandler {
/// Implement the `analysis.getNavigation` request.
Future<void> getNavigation(Request request) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var params = AnalysisGetNavigationParams.fromRequest(request);
var file = params.file;
var offset = params.offset;

View file

@ -69,8 +69,6 @@ class CompletionDomainHandler extends AbstractRequestHandler {
Set<String> includedElementNames,
List<IncludedSuggestionRelevanceTag> includedSuggestionRelevanceTags,
) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
//
// Allow plugins to start computing fixes.
//

View file

@ -37,8 +37,6 @@ class DiagnosticDomainHandler implements RequestHandler {
/// Answer the `diagnostic.getServerPort` request.
Future handleGetServerPort(Request request) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
try {
// Open a port (or return the existing one).
var port = await server.diagnosticServer.getServerPort();

View file

@ -46,8 +46,6 @@ class ExecutionDomainHandler implements RequestHandler {
/// Implement the 'execution.getSuggestions' request.
void getSuggestions(Request request) async {
// // TODO(brianwilkerson) Determine whether this await is necessary.
// await null;
// var params = new ExecutionGetSuggestionsParams.fromRequest(request);
// var computer = new RuntimeCompletionComputer(
// server.resourceProvider,

View file

@ -28,8 +28,6 @@ class KytheDomainHandler extends AbstractRequestHandler {
/// Implement the `kythe.getKytheEntries` request.
Future<void> getKytheEntries(Request request) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var file = KytheGetKytheEntriesParams.fromRequest(request).file;
var driver = server.getAnalysisDriver(file);
if (driver == null) {

View file

@ -67,8 +67,6 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandAssert(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findAssertExpression, (expr) {
return 'assert(${processor.utils.getNodeText(expr)});';
}, withBraces: false);
@ -76,16 +74,12 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandElse(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findBoolExpression,
(expr) => 'if (${processor.makeNegatedBoolExpr(expr)})');
}
static Future<PostfixCompletion> expandFor(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findIterableExpression, (expr) {
var value = processor.newVariable('value');
return 'for (var $value in ${processor.utils.getNodeText(expr)})';
@ -94,8 +88,6 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandFori(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findIntExpression, (expr) {
var index = processor.newVariable('i');
return 'for (int $index = 0; $index < ${processor.utils.getNodeText(expr)}; $index++)';
@ -104,16 +96,12 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandIf(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findBoolExpression,
(expr) => 'if (${processor.utils.getNodeText(expr)})');
}
static Future<PostfixCompletion> expandNegate(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findBoolExpression,
(expr) => processor.makeNegatedBoolExpr(expr),
withBraces: false);
@ -121,8 +109,6 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandNotNull(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findObjectExpression, (expr) {
return expr is NullLiteral
? 'if (false)'
@ -132,8 +118,6 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandNull(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findObjectExpression, (expr) {
return expr is NullLiteral
? 'if (true)'
@ -143,8 +127,6 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandParen(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findObjectExpression,
(expr) => '(${processor.utils.getNodeText(expr)})',
withBraces: false);
@ -152,8 +134,6 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandReturn(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findObjectExpression,
(expr) => 'return ${processor.utils.getNodeText(expr)};',
withBraces: false);
@ -161,30 +141,22 @@ class DartPostfixCompletion {
static Future<PostfixCompletion> expandSwitch(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findObjectExpression,
(expr) => 'switch (${processor.utils.getNodeText(expr)})');
}
static Future<PostfixCompletion> expandTry(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expandTry(kind, processor.findStatement, withOn: false);
}
static Future<PostfixCompletion> expandTryon(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expandTry(kind, processor.findStatement, withOn: true);
}
static Future<PostfixCompletion> expandWhile(
PostfixCompletionProcessor processor, PostfixCompletionKind kind) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
return processor.expand(kind, processor.findBoolExpression,
(expr) => 'while (${processor.utils.getNodeText(expr)})');
}
@ -300,8 +272,6 @@ class PostfixCompletionProcessor {
TypeSystem get typeSystem => completionContext.resolveResult.typeSystem;
Future<PostfixCompletion> compute() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
node = _selectedNode();
if (node == null) {
return NO_COMPLETION;
@ -313,8 +283,6 @@ class PostfixCompletionProcessor {
Future<PostfixCompletion> expand(
PostfixCompletionKind kind, Function contexter, Function sourcer,
{bool withBraces = true}) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
AstNode expr = contexter();
if (expr == null) {
return null;
@ -350,8 +318,6 @@ class PostfixCompletionProcessor {
Future<PostfixCompletion> expandTry(
PostfixCompletionKind kind, Function contexter,
{bool withOn = false}) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
AstNode stmt = contexter();
if (stmt == null) {
return null;
@ -455,8 +421,6 @@ class PostfixCompletionProcessor {
}
Future<bool> isApplicable() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
node = _selectedNode();
if (node == null) {
return false;

View file

@ -132,8 +132,6 @@ class StatementCompletionProcessor {
statementContext.resolveResult.unit.declaredElement;
Future<StatementCompletion> compute() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
node = _selectedNode();
if (node == null) {
return NO_COMPLETION;

View file

@ -46,8 +46,6 @@ class ConvertGetterToMethodRefactoringImpl extends RefactoringImpl
@override
Future<SourceChange> createChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
change = SourceChange(refactoringName);
// function
if (element.enclosingElement is CompilationUnitElement) {
@ -59,8 +57,6 @@ class ConvertGetterToMethodRefactoringImpl extends RefactoringImpl
FieldElement field = element.variable;
var elements = await getHierarchyMembers(searchEngine, field);
await Future.forEach(elements, (ClassMemberElement member) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
if (member is FieldElement) {
var getter = member.getter;
if (!getter.isSynthetic) {
@ -84,8 +80,6 @@ class ConvertGetterToMethodRefactoringImpl extends RefactoringImpl
Future<void> _updateElementDeclaration(
PropertyAccessorElement element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// prepare "get" keyword
Token getKeyword;
{
@ -115,8 +109,6 @@ class ConvertGetterToMethodRefactoringImpl extends RefactoringImpl
}
Future _updateElementReferences(Element element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var matches = await searchEngine.searchReferences(element);
var references = getSourceReferences(matches);
for (var reference in references) {

View file

@ -39,8 +39,6 @@ class ConvertMethodToGetterRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkInitialConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// check Element type
if (element is FunctionElement) {
if (element.enclosingElement is! CompilationUnitElement) {
@ -67,8 +65,6 @@ class ConvertMethodToGetterRefactoringImpl extends RefactoringImpl
@override
Future<SourceChange> createChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
change = SourceChange(refactoringName);
// FunctionElement
if (element is FunctionElement) {
@ -80,8 +76,6 @@ class ConvertMethodToGetterRefactoringImpl extends RefactoringImpl
MethodElement method = element;
var elements = await getHierarchyMembers(searchEngine, method);
await Future.forEach(elements, (Element element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
await _updateElementDeclaration(element);
return _updateElementReferences(element);
});
@ -91,8 +85,6 @@ class ConvertMethodToGetterRefactoringImpl extends RefactoringImpl
}
Future<void> _updateElementDeclaration(Element element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// prepare parameters
FormalParameterList parameters;
{
@ -119,8 +111,6 @@ class ConvertMethodToGetterRefactoringImpl extends RefactoringImpl
}
Future<void> _updateElementReferences(Element element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var matches = await searchEngine.searchReferences(element);
var references = getSourceReferences(matches);
for (var reference in references) {

View file

@ -179,8 +179,6 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkFinalConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
result.addStatus(validateMethodName(name));
result.addStatus(_checkParameterNames());
@ -191,8 +189,6 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkInitialConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
// selection
result.addStatus(_checkSelection());
@ -231,8 +227,6 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
@override
Future<SourceChange> createChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var change = SourceChange(refactoringName);
// replace occurrences with method invocation
for (var occurrence in _occurrences) {
@ -431,8 +425,6 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
/// Checks if created method will shadow or will be shadowed by other
/// elements.
Future<RefactoringStatus> _checkPossibleConflicts() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
var parent = _parentMember.parent;
// top-level function
@ -701,8 +693,6 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
/// Prepares information about used variables, which should be turned into
/// parameters.
Future<RefactoringStatus> _initializeParameters() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
_parameters.clear();
_parametersMap.clear();
_parameterReferencesMap.clear();
@ -766,8 +756,6 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl
}
Future<void> _initializeReturnType() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var typeProvider = await resolveResult.typeProvider;
if (_selectionFunctionExpression != null) {
variableType = '';

View file

@ -94,8 +94,6 @@ class ExtractWidgetRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkFinalConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
result.addStatus(validateClassName(name));
return result;
@ -103,8 +101,6 @@ class ExtractWidgetRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkInitialConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
result.addStatus(_checkSelection());
@ -146,8 +142,6 @@ class ExtractWidgetRefactoringImpl extends RefactoringImpl
@override
Future<SourceChange> createChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var changeBuilder = DartChangeBuilder(sessionHelper.session);
await changeBuilder.addFileEdit(resolveResult.path, (builder) {
if (_expression != null) {
@ -241,13 +235,9 @@ class ExtractWidgetRefactoringImpl extends RefactoringImpl
}
Future<RefactoringStatus> _initializeClasses() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
Future<ClassElement> getClass(String name) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var element = await sessionHelper.getClass(flutter.widgetsUri, name);
if (element == null) {
result.addFatalError(
@ -258,8 +248,6 @@ class ExtractWidgetRefactoringImpl extends RefactoringImpl
}
Future<PropertyAccessorElement> getAccessor(String uri, String name) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var element = await sessionHelper.getTopLevelPropertyAccessor(uri, name);
if (element == null) {
result.addFatalError("Unable to find 'required' in $uri");
@ -280,8 +268,6 @@ class ExtractWidgetRefactoringImpl extends RefactoringImpl
/// Prepare referenced local variables and fields, that should be turned
/// into the widget class fields and constructor parameters.
Future<RefactoringStatus> _initializeParameters() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
_ParametersCollector collector;
if (_expression != null) {
var localRange = range.node(_expression);

View file

@ -63,8 +63,6 @@ class InlineLocalRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkInitialConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
// prepare variable
{

View file

@ -263,8 +263,6 @@ class InlineMethodRefactoringImpl extends RefactoringImpl
@override
Future<RefactoringStatus> checkInitialConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
// prepare method information
result.addStatus(await _prepareMethod());
@ -311,8 +309,6 @@ class InlineMethodRefactoringImpl extends RefactoringImpl
/// Initializes [_methodElement] and related fields.
Future<RefactoringStatus> _prepareMethod() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
_methodElement = null;
_methodParameters = null;
_methodBody = null;
@ -423,8 +419,6 @@ class _ReferenceProcessor {
_ReferenceProcessor(this.ref, this.reference);
Future<void> init() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
refElement = reference.element;
// prepare CorrectionUtils

View file

@ -40,8 +40,6 @@ abstract class RefactoringImpl implements Refactoring {
@override
Future<RefactoringStatus> checkAllConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = RefactoringStatus();
result.addStatus(await checkInitialConditions());
if (result.hasFatalError) {

View file

@ -104,8 +104,6 @@ abstract class RenameRefactoringImpl extends RefactoringImpl
@override
Future<SourceChange> createChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var changeName = "$refactoringName '$oldName' to '$newName'";
change = SourceChange(changeName);
await fillChange();

View file

@ -66,8 +66,6 @@ class RenameClassMemberRefactoringImpl extends RenameRefactoringImpl {
@override
Future<RefactoringStatus> checkInitialConditions() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var result = await super.checkInitialConditions();
if (element is MethodElement && (element as MethodElement).isOperator) {
result.addFatalError('Cannot rename operator.');
@ -160,8 +158,6 @@ class _ClassMemberValidator {
elementKind = element.kind;
Future<RefactoringStatus> validate() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// check if there is a member with "newName" in the same ClassElement
for (var newNameMember in getChildren(elementClass, name)) {
result.addError(
@ -292,8 +288,6 @@ class _ClassMemberValidator {
/// Fills [elements] with [Element]s to rename.
Future _prepareElements() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
if (element is ClassMemberElement) {
elements = await getHierarchyMembers(searchEngine, element);
} else {
@ -303,15 +297,11 @@ class _ClassMemberValidator {
/// Fills [references] with all references to [elements].
Future _prepareReferences() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
if (!isRename) {
return Future.value();
}
await _prepareElements();
await Future.forEach(elements, (Element element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var elementReferences = await searchEngine.searchReferences(element);
references.addAll(elementReferences);
});

View file

@ -56,8 +56,6 @@ class RenameConstructorRefactoringImpl extends RenameRefactoringImpl {
@override
Future<void> fillChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// prepare references
var matches = await searchEngine.searchReferences(element);
var references = getSourceReferences(matches);
@ -110,8 +108,6 @@ class RenameConstructorRefactoringImpl extends RenameRefactoringImpl {
}
Future<void> _replaceSynthetic() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var classElement = element.enclosingElement;
var result = await AnalysisSessionHelper(session)

View file

@ -48,8 +48,6 @@ class RenameImportRefactoringImpl extends RenameRefactoringImpl {
@override
Future<void> fillChange() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// update declaration
{
var prefix = element.prefix;

View file

@ -186,8 +186,6 @@ class _RenameUnitMemberValidator {
}
Future<RefactoringStatus> validate() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
_validateWillConflict();
if (isRename) {
references = await searchEngine.searchReferences(element);
@ -271,8 +269,6 @@ class _RenameUnitMemberValidator {
/// Validates if renamed [element] will shadow any [Element] named [name].
Future _validateWillShadow() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var declarations = await searchEngine.searchMemberDeclarations(name);
for (var declaration in declarations) {
var member = declaration.element;

View file

@ -51,8 +51,6 @@ List<Element> getClassMembers(ClassElement clazz, [String name]) {
/// Returns a [Set] with direct subclasses of [seed].
Future<Set<ClassElement>> getDirectSubClasses(
SearchEngine searchEngine, ClassElement seed) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var matches = await searchEngine.searchSubtypes(seed);
return matches.map((match) => match.element).cast<ClassElement>().toSet();
}
@ -83,8 +81,6 @@ List<Element> getExtensionMembers(ExtensionElement extension, [String name]) {
/// their subclasses.
Future<Set<ClassMemberElement>> getHierarchyMembers(
SearchEngine searchEngine, ClassMemberElement member) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
Set<ClassMemberElement> result = HashSet<ClassMemberElement>();
// extension member
if (member.enclosingElement is ExtensionElement) {
@ -125,8 +121,6 @@ Future<Set<ClassMemberElement>> getHierarchyMembers(
/// corresponding named parameters in the method hierarchy.
Future<List<ParameterElement>> getHierarchyNamedParameters(
SearchEngine searchEngine, ParameterElement element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
if (element.isNamed) {
var method = element.enclosingElement;
if (method is MethodElement) {

View file

@ -18,8 +18,6 @@ class SearchEngineImpl implements SearchEngine {
@override
Future<Set<String>> membersOfSubtypes(ClassElement type) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var drivers = _drivers.toList();
var searchedFiles = _createSearchedFiles(drivers);
@ -29,8 +27,6 @@ class SearchEngineImpl implements SearchEngine {
var members = <String>{};
Future<void> addMembers(ClassElement type, SubtypeResult subtype) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
if (subtype != null && !visitedIds.add(subtype.id)) {
return;
}
@ -57,13 +53,9 @@ class SearchEngineImpl implements SearchEngine {
@override
Future<Set<ClassElement>> searchAllSubtypes(ClassElement type) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var allSubtypes = <ClassElement>{};
Future<void> addSubtypes(ClassElement type) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var directResults = await _searchDirectSubtypes(type);
for (var directResult in directResults) {
var directSubtype = directResult.enclosingElement as ClassElement;
@ -79,8 +71,6 @@ class SearchEngineImpl implements SearchEngine {
@override
Future<List<SearchMatch>> searchMemberDeclarations(String name) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var allDeclarations = <SearchMatch>[];
var drivers = _drivers.toList();
for (var driver in drivers) {
@ -92,8 +82,6 @@ class SearchEngineImpl implements SearchEngine {
@override
Future<List<SearchMatch>> searchMemberReferences(String name) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var allResults = <SearchResult>[];
var drivers = _drivers.toList();
var searchedFiles = _createSearchedFiles(drivers);
@ -107,8 +95,6 @@ class SearchEngineImpl implements SearchEngine {
@override
Future<List<SearchMatch>> searchReferences(Element element) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var allResults = <SearchResult>[];
var drivers = _drivers.toList();
var searchedFiles = _createSearchedFiles(drivers);
@ -121,16 +107,12 @@ class SearchEngineImpl implements SearchEngine {
@override
Future<List<SearchMatch>> searchSubtypes(ClassElement type) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var results = await _searchDirectSubtypes(type);
return results.map(SearchMatchImpl.forSearchResult).toList();
}
@override
Future<List<SearchMatch>> searchTopLevelDeclarations(String pattern) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var allElements = <Element>{};
var regExp = RegExp(pattern);
var drivers = _drivers.toList();
@ -152,8 +134,6 @@ class SearchEngineImpl implements SearchEngine {
}
Future<List<SearchResult>> _searchDirectSubtypes(ClassElement type) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
var allResults = <SearchResult>[];
var drivers = _drivers.toList();
var searchedFiles = _createSearchedFiles(drivers);