Lin-Xcode5 icon indicating copy to clipboard operation
Lin-Xcode5 copied to clipboard

Customized Macro?

Open coneybeare opened this issue 11 years ago • 10 comments

I use a special macro which has the same argument order as NSLocalizedString(key, comment)... how can I tell Lin to use my custom macro (_ls(key, comment)) instead?

coneybeare avatar Mar 11 '14 12:03 coneybeare

@coneybeare Yeah, it's a very useful feature request.

jasonhotsauce avatar Mar 20 '14 23:03 jasonhotsauce

+1 for that feature

Would be great to have a way to configure custom macros that be recognized along with standard NSLocalizedString* macros.

amarcadet avatar Mar 21 '14 18:03 amarcadet

I will try to make this feature this weekend.

jasonhotsauce avatar Mar 21 '14 18:03 jasonhotsauce

I created this feature in my fork. But not sure if it fits your needs. It basically asks you to input your own regx to detect the command. Maybe it's not so convenient to some of you. So please let me know how you think it should work. @amarcadet @coneybeare

jasonhotsauce avatar Mar 25 '14 15:03 jasonhotsauce

Couldn't you just do it as a defaults write command?

coneybeare avatar Mar 25 '14 15:03 coneybeare

Explain more please? What do you mean by defaults write?

jasonhotsauce avatar Mar 25 '14 15:03 jasonhotsauce

You can use the defaults command line tool in terminal to set any NSUserDefaults item. Why not just set the macro string that way, then you read it in the plugin?

On Tue, Mar 25, 2014 at 8:58 AM, Wenbin Zhang [email protected] wrote:

Explain more please? What do you mean by defaults write?

Reply to this email directly or view it on GitHub: https://github.com/questbeat/Lin-Xcode5/issues/21#issuecomment-38582636

coneybeare avatar Mar 25 '14 16:03 coneybeare

I prefer to have it as part of the plugin so you don't actually have to leave Xcode and use command line tool. I created UI to allow you to input macro string regx and store that in NSUserDefaults. That's the basic idea. But now I think not everybody is very familiar with regx and it might not be very convenient? Or maybe I think too much.

jasonhotsauce avatar Mar 25 '14 16:03 jasonhotsauce

@coneybeare You can try it out from my fork? And also maybe you might come up with some better ideas.

jasonhotsauce avatar Mar 25 '14 16:03 jasonhotsauce

I won't be able to for a few weeks. I really think anybody who works with Xcode will be comfortable on the command line, so my idea is to just let somebody edit it that way. It seems the easiest to maintain

coneybeare avatar Mar 26 '14 17:03 coneybeare