[TxMt] Objective-C++ language grammar and NSLocalizedString, etc.

Hans-Jörg Bibiko bibiko at eva.mpg.de
Thu Mar 4 09:50:11 UTC 2010


Hi,

If have a tiny problem since I'm using NSLocalizedString a lot in a project. We had a similar discussion at irc a couple of months ago and maybe I came across with a solution.

E.g. you have the following Objective-C++ file:

@implementation AClass

- (void)foo:(NSDictionary *)w
{
	MyFun(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK"), 
		nil, nil, tableWindow, self, nil, nil, nil,
		NSLocalizedString(@"bla", @"bla"));
	NSBeep();
}

- (void)foo2:(NSDictionary *)w
{

}

you'll see in the Symbol List:
AClass
	- foo:
NSLocalizedString
NSBeep
	- foo2:


which could be sometimes useful but the NS... stuff disturb generally. Then I looked at the Objective-C++ Language definitions and I found:

...
patterns = (
	{	include = 'source.c++'; },
	{	include = 'source.objc'; },
);
...

This means that 'source.c++' will be processed before 'source.objc'. By my opinion this is the wrong order. Because if I change this into:
...
patterns = (
	{	include = 'source.objc'; },
	{	include = 'source.c++'; },
);
...

I get for the above example the correct Symbol List:
AClass
	- foo:
	- foo2:

Are there any reasons for that language grammar order?

Regards,
--Hans


More information about the textmate mailing list