Reputation: 2741
I want to modify Xcode syntax highlighting. Namely, I do a lot of 'NSAsserts', which I find visually distracting, and so I would like lines starting with 'NSAssert' to be a light gray. This way, I can focus upon my code logic instead of having to cognitively filter-out the NSAssert lines.
Upvotes: 2
Views: 1060
Reputation: 1734
I use a lot of these too, and I liked your idea enough to work out the answer. Well, sort of: I have not worked out how to treat NSAsserts as a new item but I have worked out how to make them appear as comments in the syntax highlighter.
--- /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/BaseSupport.xclangspec 2010-10-05 00:27:45.000000000 +0100 +++ /Users/philwill/Library/Application Support/Developer/Shared/Xcode/Specifications/BaseSupport.xclangspec 2010-12-14 11:36:51.000000000 +0000 @@ -100,9 +100,8 @@ Identifier = "xcode.lang.comment.singleline"; BasedOn = "xcode.lang.comment"; // for text macros Syntax = { - Start = "//"; - EscapeChar = "\\"; - Until = "\n"; + StartChars = "/N"; + Match=("//.*$","NSC?Assert[12345]?[[:space:]]*\\([^;]*\\)[[:space:]]*;"); IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" ); Type = "xcode.syntax.comment"; };
Caveats:
Upvotes: 2