Last active
September 20, 2016 06:25
-
-
Save mavris/ab9ebde3173049aedaa49e5076e41c06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandler:(void (^)(NSError * _Nullable nilOrError))completionHandler { | |
//Checks if the file contains source code of Objective-C or Swift. Then is sets the appropriate variables | |
if ([invocation.buffer.contentUTI isEqualToString:@"public.objective-c-source"]) { | |
logString = @"NSLog("; | |
logCommentString=@"DSLog("; | |
regularExpressionString =@"NSLog\\([^\\)]*\\)[\\s]*\\;"; | |
regularExpressionCommentString=@"\\/\\*DSLog\\([^\\)]*\\)[\\s]*\\;\\*\\/"; | |
} | |
else if ([invocation.buffer.contentUTI isEqualToString:@"public.swift-source"]){ | |
logString = @"print("; | |
logCommentString = @"drint("; | |
regularExpressionString =@"(Swift.){0,1}print\\([^\\)]*\\)[\t]*[\\;]{0,1}"; | |
regularExpressionCommentString=@"\\/\\*(Swift.){0,1}drint\\([^\\)]*\\)[\ts]*[\\;]{0,1}\\*\\/"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment