File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Sources/SourceKitLSP/Swift Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,10 @@ final class SwiftCodeLensScanner: SyntaxVisitor {
70
70
if attribute. trimmedDescription == " @main " {
71
71
let range = self . snapshot. absolutePositionRange ( of: attribute. trimmedRange)
72
72
var targetNameToAppend : String = " "
73
+ var arguments : [ LSPAny ] = [ ]
73
74
if let targetName {
74
75
targetNameToAppend = " \( targetName) "
76
+ arguments. append ( . string( targetName) )
75
77
}
76
78
77
79
if let runCommand = supportedCommands [ SupportedCodeLensCommand . run] {
@@ -80,7 +82,7 @@ final class SwiftCodeLensScanner: SyntaxVisitor {
80
82
self . result. append (
81
83
CodeLens (
82
84
range: range,
83
- command: Command ( title: " Run " + targetNameToAppend, command: runCommand, arguments: nil )
85
+ command: Command ( title: " Run " + targetNameToAppend, command: runCommand, arguments: arguments )
84
86
)
85
87
)
86
88
}
@@ -89,7 +91,7 @@ final class SwiftCodeLensScanner: SyntaxVisitor {
89
91
self . result. append (
90
92
CodeLens (
91
93
range: range,
92
- command: Command ( title: " Debug " + targetNameToAppend, command: debugCommand, arguments: nil )
94
+ command: Command ( title: " Debug " + targetNameToAppend, command: debugCommand, arguments: arguments )
93
95
)
94
96
)
95
97
}
You can’t perform that action at this time.
0 commit comments