Fixed Playground support for Xcode Extension

This commit is contained in:
Nick Lockwood
2016-11-09 20:52:08 +00:00
parent 64ec9134f8
commit 2e616d76eb
2 changed files with 2 additions and 2 deletions
@@ -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)
}