Custom text macros in Xcode not getting invoked with control-dot
I created an "ObjectiveC.xctxtmacro" file in ~/Library/Application Support/Developer/Shared/Xcode/Specifications with the code bellow. I see "Hello" in Xcode's Edit>Insert Text Macros>Objective-C menu item but when I try to invoke it using control-dot, nothing happens. Any ideas?
(
{
Identifier = objc.hello;
BasedOn = objc;
IsMenuItem = YES;
Name = "Hello";
TextString开发者_运维百科 = "Hello, Xcode!";
CompletionPrefix = "hello";
IncludeContexts = ("xcode.lang.objc");
}
)
You need to add an OnlyAtBOL specification to your macro.
Try this:
(
{
Identifier = objc.hello;
BasedOn = objc;
OnlyAtBOL = YES;
IsMenuItem = YES;
Name = "Hello";
TextString = "Hello, Xcode!";
CompletionPrefix = "hello";
IncludeContexts = ("xcode.lang.objc");
}
)
I am pretty new at text macros, but as far as i understand OnlyAtBOL means that this text macro will complete only when it is at the beggining of the line (YES) or not (NO).
It seems weird that it does not work without this specification, i don' t know if it' s a bug or feature :)
You might want to check this topic, since its probably the same thing you are trying to do: http://forums.pragprog.com/forums/104/topics/3334
精彩评论