diff --git a/EditorExtension/Extension/FormatEntireFileCommand.swift b/EditorExtension/Extension/FormatEntireFileCommand.swift index aa6615f5..dbed532a 100644 --- a/EditorExtension/Extension/FormatEntireFileCommand.swift +++ b/EditorExtension/Extension/FormatEntireFileCommand.swift @@ -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) } diff --git a/EditorExtension/Extension/FormatSelectedSourceCommand.swift b/EditorExtension/Extension/FormatSelectedSourceCommand.swift index 1cae0e6d..4c5f8344 100644 --- a/EditorExtension/Extension/FormatSelectedSourceCommand.swift +++ b/EditorExtension/Extension/FormatSelectedSourceCommand.swift @@ -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) }