<?xml version="1.0" encoding="UTF-8"?>
<itemizer language-context="ruby">

	<!-- class MyClass ... end -->
	<item name="ruby.class">
		<class>ESCodeClassItem</class>
		<start-zone>class.definition:has-child(name:capture(name))</start-zone>
		<end-zone>keyword.control.delimiter</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- class << self ... end -->
	<item name="ruby.class">
		<class>ESCodeClassItem</class>
		<start-zone>class.definition:has-child(parent:capture(name))</start-zone>
		<end-zone>keyword.control.delimiter</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- module myModule ... end -->
	<item name="ruby.class">
		<class>ESCodeClassItem</class>
		<start-zone>module.definition:has-child(name:capture(name))</start-zone>
		<end-zone>keyword.control.delimiter</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- def myFunction ... end -->
	<item name="ruby.function.named">
		<start-zones>keyword.control.x-def + x-item-start:has-child(function.definition:has-child(name:capture(name)))</start-zones>
		<end-zone>keyword.control.delimiter</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- someBlockCall do |arg| ... end -->
	<item name="ruby.function.anonymous.keyword">
		<class>ESJSAnonymousFunctionItem</class>
		<start-zone>x-item-block > x-item-start:has-child(keyword.control.x-do)</start-zone>
		<end-zone>x-item-body + keyword.control.delimiter</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- someBlockCall { |arg| ... } -->
	<item name="ruby.function.anonymous">
		<class>ESJSAnonymousFunctionItem</class>
		<start-zone>variable:not(x-assignment) + brace.curly.open</start-zone>
		<end-zone>brace.curly.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- someBlockCall(cond) { |arg| ... } -->
	<item name="ruby.function.anonymous.parameters">
		<class>ESJSAnonymousFunctionItem</class>
		<start-zone>variable.function:not(x-assignment) + brace.round.open ~ brace.round.close + brace.curly.open</start-zone>
		<end-zone>brace.curly.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- if stuff ... end -->
	<item name="ruby.control-statement.end-terminated">
		<class>ESJSChunkBlockItem</class>
		<start-zone>x-item-block > x-item-start:has-child(keyword.control:capture(name))</start-zone>
		<end-zone>x-item-body + keyword.control.delimiter</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- something = { ... } -->
	<!-- Object and array literals are somewhat specific to Javascript, so these are tied specifically to the JS syntax -->
	<item name="ruby.literal.object">
		<class>ESJSLiteralObjectItem</class>
		<start-zones>variable.x-assignment:has-child(name:capture(name)) + brace.curly.open</start-zones>
		<end-zone>brace.curly.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	<item name="ruby.literal.object.quoted">
		<class>ESJSLiteralObjectItem</class>
		<start-zones>variable.x-assignment:has-child(string:has-child(name:capture(name))) + brace.curly.open</start-zones>
		<end-zone>brace.curly.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- var something = [ ... ] -->
	<item name="ruby.literal.array">
		<class>ESJSLiteralArrayItem</class>
		<start-zones>variable.x-assignment:has-child(name:capture(name)) + brace.square.open</start-zones>
		<end-zone>brace.square.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	<item name="ruby.literal.array.quoted">
		<class>ESJSLiteralArrayItem</class>
		<start-zones>variable.x-assignment:has-child(string:has-child(name:capture(name))) + brace.square.open</start-zones>
		<end-zone>brace.square.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- [ ... ] -->
	<item name="ruby.literal.array.anonymous">
		<class>ESJSLiteralArrayItem</class>
		<start-zone>*:not(brace.close, variable) + brace.square.open</start-zone>
		<end-zone>brace.square.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- { ... } -->
	<item name="ruby.block.anonymous">
		<class>ESCodeBlockItem</class>
		<start-zone>brace.curly.open</start-zone>
		<end-zone>brace.curly.close</end-zone>
		<subitems>
			<include-root-itemizers/>
		</subitems>
	</item>
	
	<!-- # !My Bookmark Comment -->
	<item name="ruby.comment">
	    <class>ESCommentItem</class>
	    <zone>comment.documentation, comment.bookmark, comment.task, comment.shebang</zone>
	</item>
	
</itemizer>