                 }
             }
         }
-        
-        do {
-            regex = try NSRegularExpression(pattern: " *:", options: .caseInsensitive)
-        } catch _ {
-            completionHandler(NSError(domain: "SampleExtension", code: -1, userInfo: [NSLocalizedDescriptionKey: ""]))
-            return
-        }
-        
+    }
+
+    func alignTypeDeclaration(invocation: XCSourceEditorCommandInvocation, selection: XCSourceTextRange) throws {
+        var regex: NSRegularExpression?
+        regex = try NSRegularExpression(pattern: " *:", options: .caseInsensitive)
+
         let alignPosition1 = invocation.buffer.lines.enumerated().map { i, line -> Int in
             guard i >= selection.start.line && i <= selection.end.line,
                 let line = line as? String,

        for index in selection.start.line ... selection.end.line {
            guard let line = invocation.buffer.lines[index] as? String,
                let result = regex?.firstMatch(in: line, options: .reportProgress, range: NSRange(location: 0, length: line.characters.count)) else {
                continue
            }

            let range = result.rangeAt(2)

                }
            }
        }
    }
}
