File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Sources/SourceKitLSP/Swift Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,20 @@ final class SyntacticSwiftTestingTestScanner: SyntaxVisitor {
345
345
346
346
let ( hasBackticks, baseName) = backtickIfNeeded ( identifier)
347
347
let fullName = " \( baseName) ( \( parameters) ) "
348
+
349
+ // If we have a display name provided by the attribute, use it, otherwise
350
+ // we can infer the display name from a raw identifier if we have one.
351
+ //
352
+ // A raw identifier is considered an alternative way of spelling the display
353
+ // name, so e.g these have the same display name:
354
+ //
355
+ // ```
356
+ // @Test("foo bar") func foo() {}
357
+ // @Test func `foo bar`() {}
358
+ // ```
359
+ //
360
+ // as such it shouldn't include any parameters. If we just have a regular
361
+ // name then we use the full name as the display name.
348
362
let displayName = attributeData. displayName ?? ( hasBackticks ? identifier. name : fullName)
349
363
350
364
let range = snapshot. absolutePositionRange (
You can’t perform that action at this time.
0 commit comments