@@ -261,8 +261,6 @@ enum class NotRecommendedReason : uint8_t {
261261 RedundantImportIndirect, // contextual
262262 Deprecated, // context-free
263263 SoftDeprecated, // context-free
264- InvalidAsyncContext, // contextual
265- CrossActorReference, // contextual
266264 VariableUsedInOwnDefinition, // contextual
267265 NonAsyncAlternativeUsedInAsyncContext, // contextual
268266
@@ -300,9 +298,6 @@ enum class ContextualNotRecommendedReason : uint8_t {
300298 None = 0 ,
301299 RedundantImport,
302300 RedundantImportIndirect,
303- // / A method that is async is being used in a non-async context.
304- InvalidAsyncContext,
305- CrossActorReference,
306301 VariableUsedInOwnDefinition,
307302 // / A method that is sync and has an async alternative is used in an async
308303 // / context.
@@ -374,7 +369,6 @@ class ContextFreeCodeCompletionResult {
374369 CodeCompletionMacroRoles MacroRoles;
375370
376371 bool IsSystem : 1 ;
377- bool IsAsync : 1 ;
378372 // / Whether the result has been annotated as having an async alternative that
379373 // / should be preferred in async contexts.
380374 bool HasAsyncAlternative : 1 ;
@@ -409,7 +403,7 @@ class ContextFreeCodeCompletionResult {
409403 ContextFreeCodeCompletionResult (
410404 CodeCompletionResultKind Kind, uint8_t AssociatedKind,
411405 CodeCompletionOperatorKind KnownOperatorKind,
412- CodeCompletionMacroRoles MacroRoles, bool IsSystem, bool IsAsync,
406+ CodeCompletionMacroRoles MacroRoles, bool IsSystem,
413407 bool HasAsyncAlternative, CodeCompletionString *CompletionString,
414408 NullTerminatedStringRef ModuleName,
415409 NullTerminatedStringRef BriefDocComment,
@@ -421,7 +415,7 @@ class ContextFreeCodeCompletionResult {
421415 NullTerminatedStringRef FilterName,
422416 NullTerminatedStringRef NameForDiagnostics)
423417 : Kind(Kind), KnownOperatorKind(KnownOperatorKind),
424- MacroRoles (MacroRoles), IsSystem(IsSystem), IsAsync(IsAsync),
418+ MacroRoles (MacroRoles), IsSystem(IsSystem),
425419 HasAsyncAlternative(HasAsyncAlternative),
426420 CompletionString(CompletionString), ModuleName(ModuleName),
427421 BriefDocComment(BriefDocComment), AssociatedUSRs(AssociatedUSRs),
@@ -438,8 +432,6 @@ class ContextFreeCodeCompletionResult {
438432 " Completion item should have diagnostic message iff the diagnostics "
439433 " severity is not none" );
440434 assert (CompletionString && " Result should have a completion string" );
441- assert (!(HasAsyncAlternative && IsAsync) &&
442- " A function shouldn't be both async and have an async alternative" );
443435 if (isOperator () && KnownOperatorKind == CodeCompletionOperatorKind::None) {
444436 this ->KnownOperatorKind = getCodeCompletionOperatorKind (CompletionString);
445437 }
@@ -456,7 +448,7 @@ class ContextFreeCodeCompletionResult {
456448 static ContextFreeCodeCompletionResult *createPatternOrBuiltInOperatorResult (
457449 CodeCompletionResultSink &Sink, CodeCompletionResultKind Kind,
458450 CodeCompletionString *CompletionString,
459- CodeCompletionOperatorKind KnownOperatorKind, bool IsAsync ,
451+ CodeCompletionOperatorKind KnownOperatorKin ,
460452 NullTerminatedStringRef BriefDocComment,
461453 CodeCompletionResultType ResultType,
462454 ContextFreeNotRecommendedReason NotRecommended,
@@ -494,7 +486,7 @@ class ContextFreeCodeCompletionResult {
494486 static ContextFreeCodeCompletionResult *
495487 createDeclResult (CodeCompletionResultSink &Sink,
496488 CodeCompletionString *CompletionString,
497- const Decl *AssociatedDecl, bool IsAsync,
489+ const Decl *AssociatedDecl,
498490 bool HasAsyncAlternative, NullTerminatedStringRef ModuleName,
499491 NullTerminatedStringRef BriefDocComment,
500492 ArrayRef<NullTerminatedStringRef> AssociatedUSRs,
@@ -533,8 +525,6 @@ class ContextFreeCodeCompletionResult {
533525
534526 bool isSystem () const { return IsSystem; };
535527
536- bool isAsync () const { return IsAsync; };
537-
538528 bool hasAsyncAlternative () const { return HasAsyncAlternative; };
539529
540530 CodeCompletionString *getCompletionString () const { return CompletionString; }
@@ -716,12 +706,8 @@ class CodeCompletionResult {
716706 return NotRecommendedReason::RedundantImport;
717707 case ContextualNotRecommendedReason::RedundantImportIndirect:
718708 return NotRecommendedReason::RedundantImportIndirect;
719- case ContextualNotRecommendedReason::InvalidAsyncContext:
720- return NotRecommendedReason::InvalidAsyncContext;
721709 case ContextualNotRecommendedReason::NonAsyncAlternativeUsedInAsyncContext:
722710 return NotRecommendedReason::NonAsyncAlternativeUsedInAsyncContext;
723- case ContextualNotRecommendedReason::CrossActorReference:
724- return NotRecommendedReason::CrossActorReference;
725711 case ContextualNotRecommendedReason::VariableUsedInOwnDefinition:
726712 return NotRecommendedReason::VariableUsedInOwnDefinition;
727713 }
0 commit comments