Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 106 additions & 70 deletions packages/vscode-ruby/syntaxes/ruby.cson.json
Original file line number Diff line number Diff line change
Expand Up @@ -2745,16 +2745,15 @@
]
},
"yard": {
"name": "comment.line.yard.ruby",
"patterns": [
{
"include": "#yard_comment"
},
{
"include": "#yard_name_types"
"include": "#yard_param_types"
},
{
"include": "#yard_param_types"
"include": "#yard_option"
},
{
"include": "#yard_tag"
Expand All @@ -2764,30 +2763,97 @@
},
{
"include": "#yard_directive"
},
{
"include": "#yard_see"
},
{
"include": "#yard_macro_attribute"
}
]
},
"yard_see": {
"comment": "separate rule for @see because name could contain url",
"begin": "^(\\s*)(#)(\\s*)(@)(see)(?=\\s)(\\s+(.+?))?(?=\\s|$)",
"beginCaptures": {
"2": {
"name": "punctuation.definition.comment.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
},
"7": {
"name": "comment.line.parameter.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
{
"include": "#yard"
},
{
"include": "#yard_continuation"
}
]
},
"yard_macro_attribute": {
"comment": "separate rule for attribute and macro tags because name goes after []",
"begin": "^(\\s*)(#)(\\s*)(@!)(attribute|macro)(\\s+((\\[).+(])))?(?=\\s)(\\s+([a-z_]\\w*:?))?",
"beginCaptures": {
"2": {
"name": "punctuation.definition.comment.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
},
"7": {
"name": "comment.line.type.yard.ruby"
},
"8": {
"name": "comment.line.punctuation.yard.ruby"
},
"9": {
"name": "comment.line.punctuation.yard.ruby"
},
"11": {
"name": "comment.line.parameter.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
{
"include": "#yard"
},
{
"include": "#yard_continuation"
}
]
},
"yard_comment": {
"comment": "For YARD tags that follow the tag-comment pattern",
"begin": "^(\\s*)(#)(\\s*)(@)(abstract|api|author|deprecated|example|macro|note|overload|since|todo|version)(?=\\s|$)",
"beginCaptures": {
"1": {
"name": "comment.line.yard.ruby"
},
"2": {
"name": "punctuation.definition.comment.ruby"
},
"3": {
"name": "comment.line.yard.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,})",
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
Expand All @@ -2799,45 +2865,45 @@
}
]
},
"yard_name_types": {
"comment": "For YARD tags that follow the tag-name-types-comment pattern",
"begin": "^(\\s*)(#)(\\s*)(@)(attr|attr_reader|attr_writer|see|yieldparam)(?=\\s)(\\s+([a-z_][a-zA-Z_]*))?(\\s+((\\[).+(])))?",
"yard_param_types": {
"comment": "For YARD tags that follow the tag-name-types-description or tag-types-name-description pattern",
"begin": "^(\\s*)(#)(\\s*)(@)(attr|attr_reader|attr_writer|yieldparam|param)(?=\\s)(?>\\s+(?>([a-z_]\\w*:?)|((\\[).+(]))))?(?>\\s+(?>((\\[).+(]))|([a-z_]\\w*:?)))?",
"beginCaptures": {
"1": {
"name": "comment.line.yard.ruby"
},
"2": {
"name": "punctuation.definition.comment.ruby"
},
"3": {
"name": "comment.line.yard.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
},
"6": {
"name": "comment.line.yard.ruby"
"name": "comment.line.parameter.yard.ruby"
},
"7": {
"name": "comment.line.parameter.yard.ruby"
"name": "comment.line.type.yard.ruby"
},
"8": {
"name": "comment.line.yard.ruby"
"name": "comment.line.punctuation.yard.ruby"
},
"9": {
"name": "comment.line.type.yard.ruby"
"name": "comment.line.punctuation.yard.ruby"
},
"10": {
"name": "comment.line.punctuation.yard.ruby"
"name": "comment.line.type.yard.ruby"
},
"11": {
"name": "comment.line.punctuation.yard.ruby"
},
"12": {
"name": "comment.line.punctuation.yard.ruby"
},
"13": {
"name": "comment.line.parameter.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,})",
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
Expand All @@ -2849,54 +2915,48 @@
}
]
},
"yard_param_types": {
"comment": "For YARD tags that follow the tag-param-types-comment pattern",
"begin": "^(\\s*)(#)(\\s*)(@)(option|param)(?=\\s)(\\s+([a-z_][a-zA-Z_]*:?))?(\\s+((\\[).+(])))?(\\s+(:[a-z_][a-zA-Z_]*))?",
"yard_option": {
"comment": "For YARD option tag that follow the tag-name-types-key-(value)-description pattern",
"begin": "^(\\s*)(#)(\\s*)(@)(option)(?=\\s)(?>\\s+([a-z_]\\w*:?))?(?>\\s+((\\[).+(])))?(?>\\s+((\\S*)))?(?>\\s+((\\().+(\\))))?",
"beginCaptures": {
"1": {
"name": "comment.line.yard.ruby"
},
"2": {
"name": "punctuation.definition.comment.ruby"
},
"3": {
"name": "comment.line.yard.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
},
"6": {
"name": "comment.line.yard.ruby"
"name": "comment.line.parameter.yard.ruby"
},
"7": {
"name": "comment.line.parameter.yard.ruby"
"name": "comment.line.type.yard.ruby"
},
"8": {
"name": "comment.line.yard.ruby"
"name": "comment.line.punctuation.yard.ruby"
},
"9": {
"name": "comment.line.type.yard.ruby"
"name": "comment.line.punctuation.yard.ruby"
},
"10": {
"name": "comment.line.punctuation.yard.ruby"
"name": "comment.line.keyword.yard.ruby"
},
"11": {
"name": "comment.line.punctuation.yard.ruby"
"name": "comment.line.hashkey.yard.ruby"
},
"12": {
"name": "comment.line.punctuation.yard.ruby"
"name": "comment.line.defaultvalue.yard.ruby"
},
"13": {
"name": "comment.line.keyword.yard.ruby"
"name": "comment.line.punctuation.yard.ruby"
},
"14": {
"name": "comment.line.punctuation.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,})",
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
Expand All @@ -2912,15 +2972,9 @@
"comment": "For YARD tags that are just the tag",
"match": "^(\\s*)(#)(\\s*)(@)(private)$",
"captures": {
"1": {
"name": "comment.line.yard.ruby"
},
"2": {
"name": "punctuation.definition.comment.ruby"
},
"3": {
"name": "comment.line.yard.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
Expand All @@ -2934,24 +2988,15 @@
"comment": "For YARD tags that follow the tag-types-comment pattern",
"begin": "^(\\s*)(#)(\\s*)(@)(raise|return|yield(?:return)?)(?=\\s)(\\s+((\\[).+(])))?",
"beginCaptures": {
"1": {
"name": "comment.line.yard.ruby"
},
"2": {
"name": "punctuation.definition.comment.ruby"
},
"3": {
"name": "comment.line.yard.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
},
"6": {
"name": "comment.line.yard.ruby"
},
"7": {
"name": "comment.line.type.yard.ruby"
},
Expand All @@ -2962,7 +3007,7 @@
"name": "comment.line.punctuation.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,})",
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
Expand All @@ -2976,26 +3021,17 @@
},
"yard_directive": {
"comment": "For YARD directives",
"begin": "^(\\s*)(#)(\\s*)(@!)(attribute|endgroup|group|macro|method|parse|scope|visibility)(\\s+((\\[).+(])))?(?=\\s)",
"begin": "^(\\s*)(#)(\\s*)(@!)(endgroup|group|method|parse|scope|visibility)(\\s+((\\[).+(])))?(?=\\s)",
"beginCaptures": {
"1": {
"name": "comment.line.yard.ruby"
},
"2": {
"name": "punctuation.definition.comment.ruby"
},
"3": {
"name": "comment.line.yard.ruby"
},
"4": {
"name": "comment.line.keyword.punctuation.yard.ruby"
},
"5": {
"name": "comment.line.keyword.yard.ruby"
},
"6": {
"name": "comment.line.yard.ruby"
},
"7": {
"name": "comment.line.type.yard.ruby"
},
Expand All @@ -3006,7 +3042,7 @@
"name": "comment.line.punctuation.yard.ruby"
}
},
"end": "^(?!\\s*#\\3\\s{2,})",
"end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
"contentName": "comment.line.string.yard.ruby",
"name": "comment.line.number-sign.ruby",
"patterns": [
Expand Down
Loading