     func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {
         
         let buffer = invocation.buffer
+        if buffer.isSwiftSource == false {
+            completionHandler(MarkError.unsupportedSource(MarkErrorDesciptions.unsupportedSource))
+        }
+        
         var marksToInsert = [Any]()
-        
         if invocation.commandIdentifier.contains(CommandIdentifier.markAll) {
             marksToInsert = MarkParser.parse(buffer: buffer)
         }

import Foundation
import XcodeKit

struct CommandIdentifier {
    static let markAll = "MarkAllCommand"
    static let markSelected = "MarkSelectedCommand"
}

class SourceEditorCommand: NSObject, XCSourceEditorCommand {

    func insert(input: [Any], into buffer: XCSourceTextBuffer) {
        var insertedLinesCount = 0
        for mark in (input as! [MarkTuple]) {
            let lineIndex = (buffer.emptySelection) ? mark.lineIndex : mark.lineIndex + 2

            for markLine in mark.lines {
                buffer.lines.insert(markLine, at: lineIndex + insertedLinesCount)
                insertedLinesCount += 2
            }
        }
    }
}
