Return to Snippet

Revision: 2949
at May 16, 2007 05:27 by rjm1982


Initial Code
<!-- added after the definition for "language_constant" near the bottom -->
<key>numeric_constant</key>
<dict>
	<key>match</key>
	<string>([0-9]+)</string>
	<key>name</key>
	<string>constant.language.php</string>
</dict>
		
		
<!-- added as the last definition in the main "patterns" array -->
<dict>
	<key>begin</key>
	<string>\b([0-9a-zA-Z_-]+)\s*\(</string>
	<key>beginCaptures</key>
	<dict>
		<key>1</key>
		<dict>
			<key>name</key>
			<string>entity.name.function.php</string>
		</dict>
		<key>2</key>
		<dict>
			<key>name</key>
			<string>punctuation.definition.parameters.begin.php</string>
		</dict>
	</dict>
	<key>end</key>
	<string>\)</string>
	<key>endCaptures</key>
	<dict>
		<key>1</key>
		<dict>
			<key>name</key>
			<string>punctuation.definition.parameters.end.php</string>
		</dict>
	</dict>
	<key>name</key>
	<string>meta.function.php</string>
	<key>patterns</key>
	<array>
		<dict>
			<key>include</key>
			<string>#string-double-quoted</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#numeric_constant</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#string-single-quoted</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#string-backtick</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#var_global</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#var_global_safer</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#var_basic</string>
		</dict>
		<dict>
			<key>include</key>
			<string>#language_constant</string>
		</dict>
	</array>
</dict>				


<!-- added in the "patterns" array for the original function definition (near line 450 in the default PHP.plist -->
<dict>
	<key>include</key>
	<string>#numeric_constant</string>
</dict>

Initial URL

                                

Initial Description
This will highlight all functions not previously defined in PHP for the e text editor.   They are assigned to the "entities" in the theme editor.  By default, they are highlighted only when originally defined, but not when they are in use in your code; this fixes that.  This also fixes the current setup to highlight numeric constants as such when used inside a custom function call or definition.

Initial Title
Add custom/user-defined function highlighting to the default PHP.plist for e text editor

Initial Tags
php, text, function

Initial Language
XML