Skip to content

[CodeCompletion] Remove warning for 'async in non-concurrency context' #73628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 14, 2024

This warnings don't give much benefits for developers. Code completion UI tends to show them unusable. But usually, developers can modify the context to accept async calls, e.g. by wrapping it with Task { }

rdar://126737530

@rintaro
Copy link
Member Author

rintaro commented May 14, 2024

@swift-ci Please smoke test

Comment on lines -402 to -404
if (IsAsync && !canCurrDeclContextHandleAsync) {
return ContextualNotRecommendedReason::InvalidAsyncContext;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I’m missing something, we can remove IsAsync from ContextFreeCodeCompletionResult now.

rintaro added 3 commits May 15, 2024 12:55
This warnings don't give much benefits for developers. Code completion
UI tends to show them unusable. But usually, developers can modify the
context to accept async calls, e.g. by wrapping it with `Task { }`

rdar://126737530
Same for 'async in non-concurrency' context
@rintaro rintaro force-pushed the completion-async-not-async-rdar126737530 branch from 6e9eb59 to 79a7410 Compare May 15, 2024 22:14
@rintaro
Copy link
Member Author

rintaro commented May 15, 2024

@swift-ci Please smoke test

kind, associatedKind, opKind, roles, isSystem, isAsync,
hasAsyncAlternative, string, moduleName, briefDocComment,
kind, associatedKind, opKind, roles, isSystem,
hasAsyncAlternative, string, moduleName, briefDocComment,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect formatting?

@@ -236,7 +236,6 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
auto diagSeverity =
static_cast<CodeCompletionDiagnosticSeverity>(*cursor++);
auto isSystem = static_cast<bool>(*cursor++);
auto isAsync = static_cast<bool>(*cursor++);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you increment the completion cache version number?

@rintaro
Copy link
Member Author

rintaro commented May 17, 2024

@swift-ci Please smoke test

@rintaro rintaro merged commit f62ff9b into swiftlang:main May 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants