We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 030e50d commit c9bee49Copy full SHA for c9bee49
1 file changed
PlayAwaysExtension/Commands.swift
@@ -14,7 +14,18 @@ final class Commander {
14
15
class func perform(with invocation: XCSourceEditorCommandInvocation, for platform: PAInvocation.Platform) {
16
do {
17
- try PAInvocation.invoke(with: invocation.buffer.completeBuffer, platform: platform)
+ var text = ""
18
+
19
+ invocation.buffer.selections.forEach { selection in
20
+ guard let range = selection as? XCSourceTextRange else { return }
21
22
+ for l in range.start.line...range.end.line {
23
+ guard let line = invocation.buffer.lines[l] as? String else { continue }
24
+ text.append(line)
25
+ }
26
27
28
+ try PAInvocation.invoke(with: text, platform: platform)
29
} catch {
30
NSAlert(error: error).runModal()
31
}
0 commit comments