mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-06-16 10:34:34 +00:00
Fixed Playground support for Xcode Extension
This commit is contained in:
@@ -37,7 +37,7 @@ import XcodeKit
|
||||
class FormatEntireFileCommand: NSObject, XCSourceEditorCommand {
|
||||
|
||||
func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) -> Void {
|
||||
guard invocation.buffer.contentUTI == "public.swift-source" else {
|
||||
guard ["public.swift-source", "com.apple.dt.playground"].contains(invocation.buffer.contentUTI) else {
|
||||
return completionHandler(FormatCommandError.notSwiftLanguage)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class FormatSelectedSourceCommand: NSObject, XCSourceEditorCommand {
|
||||
func perform(with invocation: XCSourceEditorCommandInvocation,
|
||||
completionHandler: @escaping (Error?) -> Void) -> Void {
|
||||
|
||||
guard invocation.buffer.contentUTI == "public.swift-source" else {
|
||||
guard ["public.swift-source", "com.apple.dt.playground"].contains(invocation.buffer.contentUTI) else {
|
||||
return completionHandler(FormatCommandError.notSwiftLanguage)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user