Skip to content

Commit 87ca387

Browse files
committed
Exclude expected completions for file: and line: args
We don't provide default argument completions for `#file` and `#line`, for now let's avoid matching expected results if the argument list contains `file:` and `line:`.
1 parent b5902e4 commit 87ca387

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

SourceKitStressTester/Sources/StressTester/ActionGenerators.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,19 @@ private struct ActionToken {
528528
return nil
529529
}
530530
}
531-
return expectedResultImpl(for: token, parent: parent)
531+
532+
let result = expectedResultImpl(for: token, parent: parent)
533+
534+
// If the argument labels are passing along `file` and `line` arguments,
535+
// ignore this completion since we don't include `#file` and `#line` as
536+
// completion args.
537+
// FIXME: We ought to have this be configurable and enable it for the stress
538+
// tester.
539+
let argLabels = result.name.argLabels
540+
if argLabels.contains("file") && argLabels.contains("line") {
541+
return nil
542+
}
543+
return result
532544
}
533545

534546
static func getParentArgs<T:SyntaxProtocol>(of syntax: T) -> (kind: ExpectedResult.Kind, args: [String])? {

0 commit comments

Comments
 (0)