<?xml version="1.0" encoding="UTF-8"?>
<!--

CodeSense Providers map contexts in a document to possible completions. The actual completions are defined in the various CodeSense libraries, categorized using their key. A CodeSense Provider tells Espresso what CodeSense libraries are active in the current context. One of these XML files can contain many <provider> elements.

-->
<codesense>
	
	<!-- HTML entities -->
	<provider>
		<selector>language-root.html, html character.entity, html tag > punctuation.definition.begin</selector>
		<completions>com.macrabbit.html.entities</completions>
		<complete-match capture="1">&amp;([a-zA-Z0-9]*)</complete-match>
	</provider>
	
	<!-- HTML tags -->
	<provider>
		<selector>language-root.html *, tag.open.html, tag.self-closing.html</selector>
		<completions>com.macrabbit.html.tags</completions>
		<completions>com.macrabbit.html.tags.self-closing</completions>
		<complete-match capture="2">(&lt;)([a-zA-Z0-9-]*)</complete-match>
		<require-suffix>(\s|>|^)</require-suffix>
	</provider>
	
	<!-- HTML attributes -->
	<provider>
		<selector>tag.open.html:has-child(name:capture(tag)) > attribute-name, tag.open.html:has-child(name:capture(tag)) > punctuation.definition.end, tag.open.html:has-child(name:capture(tag))</selector>
		<completions>com.macrabbit.html.tag.${tag}.attributes</completions>
		<completions>com.macrabbit.html.tag.standard-attributes</completions>
		<completions>com.macrabbit.html.tag.event-attributes</completions>
		<complete-match capture="2">(\s)([a-zA-Z0-9-]*)</complete-match>
		<require-suffix>(\s|=|>|^)</require-suffix>
	</provider>
	
	<!-- HTML attribute values for generic elements -->
	<provider>
		<selector>tag.open.html > attribute-name:capture(attribute) + punctuation.separator + string > punctuation.definition.end</selector>
		<completions>com.macrabbit.html.attribute-values.${attribute}</completions>
		<complete-match capture="2">("|')([a-zA-Z0-9._-]*)</complete-match>
	</provider>
	
	<!-- HTML attribute values for specific elements -->
	<provider>
		<selector>tag.open.html:has-child(name:capture(tag)) > attribute-name:capture(attribute) + punctuation.separator + string > punctuation.end</selector>
		<completions>com.macrabbit.html.tag.${tag}.attribute-values.${attribute}</completions>
		<complete-match capture="2">("|')([a-zA-Z0-9._/-]*)</complete-match>
		<!--require-suffix>(\s|>|^)</require-suffix-->
	</provider>

	<!-- CSS properties in a style="" attribute -->
	<provider>
		<selector>embedded.property-list.css, 
				  embedded.property-list.css > property-name, 
				  embedded.property-list.css > property-value punctuation.separator,
				  embedded.property-list.css + punctuation.definition.end</selector>
		<completions>com.macrabbit.css.properties</completions>
		<complete-match capture="2">(^|;|'|")\s*([a-zA-Z0-9-]*)</complete-match>
		<require-suffix>(:|\s|'|"|^)</require-suffix>
	</provider>
	
</codesense>
