mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Completion] Only provide macro completions when they are valid
Only return macros that are valid in their current position, ie. an attached macro is not valid on a nominal. Also return freestanding expression macros in code block item position and handle the new freestanding code item macros. Resolves rdar://105563583.
This commit is contained in:
@@ -1167,9 +1167,9 @@ Completion *CompletionBuilder::finish() {
|
||||
new (sink.allocator) ContextFreeCodeCompletionResult(
|
||||
contextFreeBase.getKind(),
|
||||
contextFreeBase.getOpaqueAssociatedKind(), opKind,
|
||||
contextFreeBase.isSystem(), contextFreeBase.isAsync(),
|
||||
contextFreeBase.hasAsyncAlternative(), newCompletionString,
|
||||
contextFreeBase.getModuleName(),
|
||||
contextFreeBase.getMacroRoles(), contextFreeBase.isSystem(),
|
||||
contextFreeBase.isAsync(), contextFreeBase.hasAsyncAlternative(),
|
||||
newCompletionString, contextFreeBase.getModuleName(),
|
||||
contextFreeBase.getBriefDocComment(),
|
||||
contextFreeBase.getAssociatedUSRs(),
|
||||
contextFreeBase.getResultType(),
|
||||
|
||||
Reference in New Issue
Block a user