--- fileTypes: - rb - rxml - builder foldingStartMarker: ! "(?x)^\n\t (\\s*+\n\t (module|class|def\n\t |unless|if\n\t \ |case\n\t |begin\n\t |for|while|until\n\t |( \"(\\\\.|[^\"])*+\" \ # eat a double quoted string\n\t | '(\\\\.|[^'])*+' # eat a single quoted string\n\t | [^#\"'] # eat all but comments and strings\n\t )*\n\t ( \\s (do|begin|case)\n\t \ | [-+=&|*/~%^<>~] \\s*+ (if|unless)\n\t )\n\t )\\b\n\t (?! [^;]*+ ; .*? \\bend\\b )\n\t |( \"(\\\\.|[^\"])*+\" # eat a double quoted string\n\t | '(\\\\.|[^'])*+' # eat a single quoted string\n\t \ | [^#\"'] # eat all but comments and strings\n\t )*\n\t \ ( \\{ (?! [^}]*+ \\} )\n\t | \\[ (?! [^\\]]*+ \\] )\n\t )\n\t ).*$\n\t| \ [#] .*? \\(fold\\) \\s*+ $ # Sune’s special marker\n\t" foldingStopMarker: ! "(?x)\n\t\t( (^|;) \\s*+ end \\s*+ ([#].*)? $\n\t\t| ^ \ \\s*+ [}\\]] \\s*+ ([#].*)? $\n\t\t| [#] .*? \\(end\\) \\s*+ $ # Sune’s special marker\n\t\t)" keyEquivalent: ^~R name: Ruby on Rails patterns: - begin: (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+ControllerTest(\s*<\s*[.a-zA-Z0-9_:]+)?))) comment: Uses lookahead to match classes with the ControllerTest suffix; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.functional_test patterns: - include: ! '#shoulda' - include: source.ruby - include: $self - begin: (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+Controller\b(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+)))(?!.+\bend\b) comment: Uses lookahead to match classes with the Controller suffix; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.controller patterns: - include: source.ruby - include: $self - begin: (^\s*)(?=module\s+((([A-Z]\w*::)*)[A-Z]\w*)Helper) comment: Uses lookahead to match modules with the Helper suffix; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.helper patterns: - include: source.ruby - include: $self - begin: (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+(\s*<\s*ActionMailer::Base)))) comment: Uses lookahead to match classes that inherit from ActionMailer::Base; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.mailer patterns: - include: source.ruby - include: $self - begin: (^\s*)(?=class\s+.+ActiveRecord::Base) comment: Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.model patterns: - include: source.ruby - include: $self - begin: (^\s*)(?=class\s+.+ActiveRecord::Migration) comment: Uses lookahead to match classes that (may) inherit from ActiveRecord::Migration; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.migration patterns: - begin: (^\s*)(?=change_table)\b comment: Uses lookahead to match methods change_table; includes 'source.ruby' to avoid infinite recursion contentName: meta.rails.migration.change_table end: ^\1(?=end)\b patterns: - include: source.ruby - include: $self - begin: (^\s*)(?=create_table)\b comment: Uses lookahead to match methods create_table; includes 'source.ruby' to avoid infinite recursion contentName: meta.rails.migration.create_table end: ^\1(?=end)\b patterns: - include: source.ruby - include: $self - include: source.ruby - include: $self - begin: (^\s*)(?=ActiveRecord::Schema.define) end: ^\1(?=end)\b name: meta.rails.schema patterns: - begin: (^\s*)(?=create_table)\b comment: Uses lookahead to match methods create_table; includes 'source.ruby' to avoid infinite recursion contentName: meta.rails.migration.create_table end: ^\1(?=end)\b patterns: - include: source.ruby - include: $self - begin: (^\s*)(?=class\s+(?![.a-zA-Z0-9_:]+ControllerTest)(([.a-zA-Z0-9_:]+Test(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+))) comment: Uses lookahead to match classes with the Test suffix; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.unit_test patterns: - include: ! '#shoulda' - include: source.ruby - include: $self - begin: (^\s*)ActionController::Routing::Routes comment: Uses ActionController::Routing::Routes to determine it is a routes file; includes 'source.ruby' to avoid infinite recursion end: ^\1(?=end)\b name: meta.rails.routes patterns: - include: source.ruby - include: $self - match: \b(before_filter|skip_before_filter|skip_after_filter|after_filter|around_filter|filter|filter_parameter_logging|layout|require_dependency|render|render_action|render_text|render_file|render_template|render_nothing|render_component|render_without_layout|rescue_from|url_for|redirect_to|redirect_to_path|redirect_to_url|respond_to|helper|helper_method|model|service|observer|serialize|scaffold|verify|hide_action)\b name: support.function.actionpack.rails - match: \b(check_box|content_for|error_messages_for|form_for|fields_for|file_field|hidden_field|image_submit_tag|label|link_to|password_field|radio_button|submit|text_field|text_area)\b name: support.function.viewhelpers.rails - match: \b(named_scope|after_create|after_destroy|after_save|after_update|after_validation|after_validation_on_create|after_validation_on_update|before_create|before_destroy|before_save|before_update|before_validation|before_validation_on_create|before_validation_on_update|composed_of|belongs_to|has_one|has_many|has_and_belongs_to_many|validate|validate_on_create|validates_numericality_of|validate_on_update|validates_acceptance_of|validates_associated|validates_confirmation_of|validates_each|validates_format_of|validates_inclusion_of|validates_exclusion_of|validates_length_of|validates_presence_of|validates_size_of|validates_uniqueness_of|attr_protected|attr_accessible|attr_readonly|accepts_nested_attributes_for|default_scope)\b name: support.function.activerecord.rails - match: \b(alias_method_chain|alias_attribute|delegate|cattr_accessor|mattr_accessor|memoize)\b name: support.function.activesupport.rails - match: \b(returning)\b name: keyword.function.activesupport.rails - begin: (Factory).define beginCaptures: '1': name: support.class.ruby end: \b(do)\b endCaptures: '1': name: keyword.control.start-block.ruby.shoulda name: meta.rails.factory.header patterns: - include: source.ruby - include: $self - include: source.ruby repository: shoulda: patterns: - begin: (^\s*)(context)\s+(("|')(.*)\4)\s+(do)\b beginCaptures: '2': name: keyword.other.context.ruby.rails.shoulda '3': name: entity.name.function.ruby.rails.shoulda '5': name: meta.context.ruby.rails.shoulda '6': name: keyword.control.start-block.ruby.shoulda end: ^\1(?=end)\b name: source.ruby.rails.shoulda patterns: - match: \b(should_validate_presence_of|should_validate_uniqueness_of|should_not_allow_mass_assignment_of|should_not_allow_values_for|should_allow_values_for|should_ensure_length_in_range|should_ensure_length_at_least|should_ensure_value_in_range|should_validate_numericality_of|should_have_many|should_have_and_belong_to_many|should_have_one|should_belong_to|should_be_restful|should_set_the_flash_to|should_not_set_the_flash|should_assign_to|should_not_assign_to|should_respond_with|should_render_template|should_redirect_to|should_render_a_form|setup|teardown|fixtures|load_all_fixtures|should_have_db_column|should_have_db_columns|should_have_index|should_have_indices|should_validate_acceptance_of|shuold_set_the_flash_to|should_have_readonly_attributes|should_change|should_not_change|should_have_named_scope|should_ensure_length_is|should_filter_params|should_respond_with_content_type|should_route|should_return_from_session)\b name: support.shoulda.macro - begin: ^\s*(should|should_eventually)\b comment: beginCaptures = { 1 = { name = 'support.function.should.ruby.rails.shoulda'; }; }; end: (\n)|\b(do)\b\s* endCaptures: '1': name: keyword.control.start-block.ruby.shoulda name: meta.should.ruby.rails.shoulda patterns: - include: source.ruby - begin: ^\s*(use_(should|setup|context))\b comment: beginCaptures = { 1 = { name = 'support.function.should.ruby.rails.shoulda.shared_should'; }; }; end: (\n)|\b(do)\b\s* endCaptures: '2': name: keyword.control.start-block.ruby.shoulda name: meta.should.ruby.rails.shoulda.shared_should patterns: - include: source.ruby - begin: ^\s*(setup)\b comment: beginCaptures = { 1 = { name = 'support.function.setup.ruby.rails.shoulda'; }; }; end: (\n)|\b(do)\b\s* endCaptures: '1': name: keyword.control.start-block.ruby.shoulda patterns: - include: source.ruby - begin: ^\s*(shared_should|shared_context_should|shared_should_be|shared_context_for|share_should|share_context|share_setup)\b comment: beginCaptures = { 1 = { name = 'support.function.should.ruby.rails.shoulda'; }; }; end: (\n)|\b(do)\b\s* endCaptures: '1': name: keyword.control.start-block.ruby.shoulda name: support.function.ruby.rails.shoulda patterns: - include: source.ruby - include: ! '#shoulda' - include: source.ruby scopeName: source.ruby.rails uuid: 54D6E91E-8F31-11D9-90C5-0011242E4184