diff --git a/Commands/Start Comments.tmCommand b/Commands/Start Comments.tmCommand index f18b2e3..d88fa1d 100644 --- a/Commands/Start Comments.tmCommand +++ b/Commands/Start Comments.tmCommand @@ -1,5 +1,5 @@ - + beforeRunningCommand diff --git a/Preferences/Deprecated.tmPreferences b/Preferences/Deprecated.tmPreferences new file mode 100644 index 0000000..339d15f --- /dev/null +++ b/Preferences/Deprecated.tmPreferences @@ -0,0 +1,21 @@ + + + + + name + Deprecated + scope + meta.tag.yard.deprecated keyword.other.documentation.deprecated.yard + settings + + background + #FFDDDD + fontStyle + bold + foreground + #606060 + + uuid + 2E14DFBA-00D5-46DE-A622-389B47B4D9EB + + diff --git a/Preferences/Keyword Tag.tmPreferences b/Preferences/Keyword Tag.tmPreferences new file mode 100644 index 0000000..36d207a --- /dev/null +++ b/Preferences/Keyword Tag.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Keyword Tag + scope + meta.tag.yard keyword.other, meta.tag.yard keyword.swagger + settings + + foreground + #606060 + + uuid + 4F9D0E17-444C-4218-90E0-46B7EF99D2E1 + + diff --git a/Preferences/Standalone Name.tmPreferences b/Preferences/Standalone Name.tmPreferences new file mode 100644 index 0000000..0297268 --- /dev/null +++ b/Preferences/Standalone Name.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Standalone Name + scope + meta.tag.yard entity.other.standalone-name.yard + settings + + foreground + #9090FF + + uuid + 96A2688D-B383-4F96-89FD-E33364325503 + + diff --git a/Preferences/Swagger kw.tmPreferences b/Preferences/Swagger kw.tmPreferences new file mode 100644 index 0000000..e8224ab --- /dev/null +++ b/Preferences/Swagger kw.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Swagger kw + scope + meta.tag.yard.swagger + settings + + background + #ECECFF + + uuid + 5759089C-E7AB-431C-BC7E-CC150E9A8FE5 + + diff --git a/Snippets/@authorize_with.tmSnippet b/Snippets/@authorize_with.tmSnippet new file mode 100644 index 0000000..1a54fcd --- /dev/null +++ b/Snippets/@authorize_with.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + @authorize_with ${1:header_authorization} +# $0 + name + @authorize_with + scope + comment.line.number-sign.ruby + tabTrigger + @auth + uuid + 9A1C7BF4-CFE3-4DEC-8252-E7537BA79779 + + diff --git a/Snippets/@example.tmSnippet b/Snippets/@example.tmSnippet new file mode 100644 index 0000000..c436893 --- /dev/null +++ b/Snippets/@example.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + # @example${1: ${2|name,200,201,301,302,401,404,422|}} +# ${4:{ $5 }}${6: +# ${7|@ro,@p,@para,@resp,@exa|}}$0 + name + @example + scope + comment.line.number-sign.ruby + tabTrigger + # @exa + uuid + C8EBBCA0-68E0-4524-87BB-9342D57448F6 + + diff --git a/Snippets/@parameter.tmSnippet b/Snippets/@parameter.tmSnippet new file mode 100644 index 0000000..6d7034a --- /dev/null +++ b/Snippets/@parameter.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + # @parameter ${1:name}${2:(${3|body,query,path,formData,required,nullable,multiple|})} [${4|integer,boolean,string,object<>,number,date,time,date-time,uuid,enum<>,array<>|}] ${5:description}${6: +# ${7|@ro,@p,@para,@resp,@exa|}}$0 + name + @parameter + scope + comment.line.number-sign.ruby + tabTrigger + # @para + uuid + 8248FC4F-D711-4576-8512-8BE9BD0E1896 + + diff --git a/Snippets/@path.tmSnippet b/Snippets/@path.tmSnippet new file mode 100644 index 0000000..05b075a --- /dev/null +++ b/Snippets/@path.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + # @path [${1|GET,POST,PATCH,PUT,DELETE|}] ${3:/api}${4:/v${5:1}}/${6:path}${7: +# ${8|@ro,@p,@para,@resp,@exa|}}$0 + name + @path + scope + comment.line.number-sign.ruby + tabTrigger + # @p + uuid + 769051AC-23B4-4B7B-AD41-179F307DFF77 + + diff --git a/Snippets/@resource.tmSnippet b/Snippets/@resource.tmSnippet new file mode 100644 index 0000000..15d3f2d --- /dev/null +++ b/Snippets/@resource.tmSnippet @@ -0,0 +1,19 @@ + + + + + content + ## +# @resource ${1:Resource}${2: +# ${3:Resource Title}}${4: +# @auth}$0 + name + @resource + scope + comment.line.number-sign.ruby + tabTrigger + # @res + uuid + 4A4FD985-8D75-48C7-8316-7D20F49E2F85 + + diff --git a/Snippets/@response.tmSnippet b/Snippets/@response.tmSnippet new file mode 100644 index 0000000..a149cd9 --- /dev/null +++ b/Snippets/@response.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + # @response${1: [${2:Model}]}${3: ${4|200,201,301,302,401,404,422|}}${5: +# ${6|@ro,@p,@para,@resp,@exa|}}$0 + name + @response + scope + comment.line.number-sign.ruby + tabTrigger + # @resp + uuid + 9161CF72-009D-4C8C-9AFC-D1E3E4F3BBE6 + + diff --git a/Snippets/@response_type.tmSnippet b/Snippets/@response_type.tmSnippet new file mode 100644 index 0000000..f3411a5 --- /dev/null +++ b/Snippets/@response_type.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + # @response_type [${1|Model,integer,boolean,string,object<>,number,date,time,date-time,uuid,enum<>,array<>|}]${2: +# ${3|@ro,@p,@para,@resp,@exa|}}$0 + name + @response_type + scope + comment.line.number-sign.ruby + tabTrigger + # @resp + uuid + 1D79331F-E6D6-47D2-8ED9-0315D9D8D961 + + diff --git a/Snippets/@route.tmSnippet b/Snippets/@route.tmSnippet new file mode 100644 index 0000000..a6eb2aa --- /dev/null +++ b/Snippets/@route.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + # @route ${1:helper_method}${2: +# ${3|@ro,@p,@para,@resp,@exa|}}$0 + name + @route + scope + comment.line.number-sign.ruby + tabTrigger + # @ro + uuid + 711D911E-80B7-46C6-8DB2-555D7C6FC3DC + + diff --git a/Snippets/Action doc.tmSnippet b/Snippets/Action doc.tmSnippet new file mode 100644 index 0000000..d51c8db --- /dev/null +++ b/Snippets/Action doc.tmSnippet @@ -0,0 +1,20 @@ + + + + + content + ${1:# # ${2:Title} +# +}${3:# ${4:Description} +# +}${5:# ${6|@ro,@p,@para,@resp,@exa|}}$0 + name + Action doc + scope + comment.line.number-sign.ruby + tabTrigger + # # + uuid + F810FEE5-98F6-4953-8DB4-6D4903634FBC + + diff --git a/Snippets/Alias Of.tmSnippet b/Snippets/Alias Of.tmSnippet new file mode 100644 index 0000000..d3a842c --- /dev/null +++ b/Snippets/Alias Of.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @alias + name + Alias Of + scope + comment.line.number-sign.ruby + tabTrigger + alias + uuid + A537FD23-3EFA-48CF-AE22-714C1A134940 + + diff --git a/Snippets/Available Since.tmSnippet b/Snippets/Available Since.tmSnippet new file mode 100644 index 0000000..cf146c0 --- /dev/null +++ b/Snippets/Available Since.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @since ${1:number} + name + Available Since + scope + comment.line.number-sign.ruby + tabTrigger + since + uuid + 312627F9-3C3D-4924-8D9A-64784B5E3842 + + diff --git a/Snippets/Calls Method.tmSnippet b/Snippets/Calls Method.tmSnippet new file mode 100644 index 0000000..57be7d5 --- /dev/null +++ b/Snippets/Calls Method.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @calls + name + Calls Method + scope + comment.line.number-sign.ruby + tabTrigger + calls + uuid + E05CA577-3978-4591-9AE9-B723ACA4EC47 + + diff --git a/Snippets/Categories.tmSnippet b/Snippets/Categories.tmSnippet new file mode 100644 index 0000000..5b01e8e --- /dev/null +++ b/Snippets/Categories.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @category ${0:categories} + name + Categories + scope + comment.line.number-sign.ruby + tabTrigger + cat + uuid + CB762D11-43B1-446A-8548-7A39581A9A89 + + diff --git a/Snippets/New Comment Line.tmSnippet b/Snippets/New Comment Line.tmSnippet index 1b858c4..c7bb443 100644 --- a/Snippets/New Comment Line.tmSnippet +++ b/Snippets/New Comment Line.tmSnippet @@ -11,8 +11,6 @@ New Comment Line scope comment.line.number-sign.ruby - tabTrigger - source.ruby uuid B8AD763C-830B-4A5B-AD40-5E7B90C83F0A diff --git a/Snippets/Parameter.tmSnippet b/Snippets/Parameter.tmSnippet new file mode 100644 index 0000000..661b941 --- /dev/null +++ b/Snippets/Parameter.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @param [${1:Types}] ${2:Name} ${3:Description} + name + Parameter + scope + comment.line.number-sign.ruby + tabTrigger + param + uuid + BA8B95D4-FB68-4988-840A-D3A23B21C6AD + + diff --git a/Snippets/Raises Exception.tmSnippet b/Snippets/Raises Exception.tmSnippet new file mode 100644 index 0000000..33802d0 --- /dev/null +++ b/Snippets/Raises Exception.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @raise [${1:ExceptionClass}] ${3:Description} + name + Raises Exception + scope + comment.line.number-sign.ruby + tabTrigger + raise + uuid + 444C3FB9-D597-4023-B50A-5ECCDAB75B7C + + diff --git a/Snippets/Returns.tmSnippet b/Snippets/Returns.tmSnippet new file mode 100644 index 0000000..989b94d --- /dev/null +++ b/Snippets/Returns.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @return [${1:Types}] ${2:Description} + name + Returns + scope + comment.line.number-sign.ruby + tabTrigger + return + uuid + 17011F12-BDDB-4FFB-8CDC-CCB5522F1A7C + + diff --git a/Snippets/See Also.tmSnippet b/Snippets/See Also.tmSnippet new file mode 100644 index 0000000..ad97b11 --- /dev/null +++ b/Snippets/See Also.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @see ${1:Name or URL} + name + See Also + scope + comment.line.number-sign.ruby + tabTrigger + see + uuid + E824781F-6806-462D-9051-4A1D3E2A1925 + + diff --git a/Snippets/Yields Block.tmSnippet b/Snippets/Yields Block.tmSnippet new file mode 100644 index 0000000..41e16a4 --- /dev/null +++ b/Snippets/Yields Block.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @yield [${1:parameter names}] ${3:Description} + name + Yields Block + scope + comment.line.number-sign.ruby + tabTrigger + yield + uuid + 821239A6-FD8A-4CC3-BDCD-BAC24AEFECE8 + + diff --git a/Snippets/Yields Parameter.tmSnippet b/Snippets/Yields Parameter.tmSnippet new file mode 100644 index 0000000..d26a377 --- /dev/null +++ b/Snippets/Yields Parameter.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + @yieldparam [${1:Types}] ${2:name} ${3:Description} + name + Yields Parameter + scope + comment.line.number-sign.ruby + tabTrigger + yparam + uuid + 51A5C475-1977-4408-BCAB-7F3BFEA3664F + + diff --git a/Syntaxes/YARD.tmLanguage b/Syntaxes/YARD.tmLanguage new file mode 100644 index 0000000..fb6a690 --- /dev/null +++ b/Syntaxes/YARD.tmLanguage @@ -0,0 +1,334 @@ + + + + + fileTypes + + injectionSelector + comment + name + YARD + patterns + + + begin + (?<=#\s)\s*(@)(?!return|param\b|groups|model|\!model|resource)(!?[a-z][\w\-]+[a-z])\b(?!\.|\s*(?:\|\|)?=\s*) + beginCaptures + + 1 + + name + punctuation.definition.keyword.other.documentation.tag.yard + + 2 + + name + keyword.other.documentation.tag.yard + + + end + (?=\n) + name + meta.tag.yard + patterns + + + begin + (?<=\s)\s*(\[) + beginCaptures + + 1 + + name + punctuation.definition.parameters.begin.yard + + + end + (\])(?:\s+([a-z]\w*))?(?=\s|\n) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.yard + + 2 + + name + entity.other.attribute-name.yard + + + name + meta.array.parameters.yard + patterns + + + include + #directive_class + + + include + #directive_array + + + include + #attr_name + + + include + #param_seperator + + + + + + + begin + (?<=#\s)\s*(@)(return)\b(?!\.|\s*=\s*) + beginCaptures + + 1 + + name + punctuation.definition.keyword.other.documentation.tag.yard + + 2 + + name + keyword.other.documentation.tag.yard + + + end + (?=\n|$) + name + meta.tag.yard.return + patterns + + + begin + (?<=@return\s)\s*(?:\s*([a-z]\w*)\s)?\s*(\[) + beginCaptures + + 1 + + name + entity.other.attribute-name.yard + + 2 + + name + punctuation.definition.parameters.begin.yard + + + end + (\])(?=\s|\n|$) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.yard + + + name + meta.array.parameters.yard + patterns + + + include + #array_params + + + + + + + begin + (?<=#\s)\s*(@)(param)\b(?!\.|\s*=\s*) + beginCaptures + + 1 + + name + punctuation.definition.keyword.other.documentation.tag.yard + + 2 + + name + keyword.other.documentation.tag.yard + + + end + (?=\n|$) + name + meta.tag.yard.param + patterns + + + begin + (?<=@param\s)\s*(?:\s*([a-z]\w*)\s)?\s*(\[) + beginCaptures + + 1 + + name + entity.other.attribute-name.yard + + 2 + + name + punctuation.definition.parameters.begin.yard + + + end + (\])(?=\s|\n|$) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.yard + + + name + meta.array.parameters.yard + patterns + + + include + #array_params + + + + + + + captures + + 1 + + name + punctuation.definition.keyword.other.documentation.tag.yard + + 2 + + name + keyword.other.documentation.deprecated.yard + + + match + (?<=#\s)\s*(@)(!deprecated)(?=\n|$) + name + meta.tag.yard.deprecated + + + begin + (?<=#\s)\s*(@)(!?model|resource)\b(?!\.|\s*=\s*) + beginCaptures + + 1 + + name + punctuation.definition.keyword.other.documentation.tag.yard + + 2 + + name + keyword.swagger.documentation.tag.yard + + + end + (?=\n|$) + name + meta.tag.yard.swagger + patterns + + + include + #standalone_name + + + + + repository + + array_params + + patterns + + + include + #directive_class + + + include + #directive_array + + + include + #param_seperator + + + + attr_name + + match + \b([a-z]\w*)\b + name + entity.other.attribute-name.yard + + directive_array + + captures + + 1 + + name + punctuation.definition.array.begin.yard + + 2 + + name + keyword.other.directive.class.yard + + 3 + + name + punctuation.definition.array.end.yard + + + match + \bArray(?:(\<)([A-Z]\w+(?:::[A-Z]\w+)*)(\>))?\b + name + keyword.other.directive.array.yard + + directive_class + + match + \b[A-Z]\w+(?:::[A-Z]\w+)*\b + name + keyword.other.directive.class.yard + + param_seperator + + match + ,\s* + name + punctuation.separator.parameters.yard + + standalone_name + + match + \b[A-Z]\w+(?:::[A-Z]\w+)*\b + name + entity.other.standalone-name.yard + + + scope + source.ruby + scopeName + text.yard + uuid + A8EEAEB2-BB67-4F21-9A8F-D528A9CE0830 + + diff --git a/Syntaxes/yard.textmate.tmLanguage b/Syntaxes/yard.textmate.tmLanguage new file mode 100644 index 0000000..33ccbf8 --- /dev/null +++ b/Syntaxes/yard.textmate.tmLanguage @@ -0,0 +1,71 @@ +{ patterns = ( + { name = 'meta.tag.yard'; + begin = '(?<=#\s)(@)([_a-zA-Z][_a-zA-Z0-9\-]*)\b(?!\.|\s*=\s*)'; + end = '(?=\n|$)'; + beginCaptures = { + 1 = { name = 'punctuation.definition.keyword.other.documentation.tag.yard'; }; + 2 = { name = 'keyword.other.documentation.tag.yard'; }; + }; + patterns = ( + { include = "#name"; }, + { include = "#types"; }, + { include = "#description"; } + ); + }, + { name = 'meta.tag.yard.param'; + match = '(?<=#\s)(@)(param)'; + } + ); + repository = { + array_type = { + name = 'keyword.other.directive.array.yard'; + begin = 'Array(\<)'; + end = '\>'; + beginCaptures = { 1 = { name = 'punctuation.definition.parameters.yard'; }; }; + endCaptures = { 0 = { name = 'punctuation.definition.parameters.yard'; }; }; + patterns = ( + { begin = '(?=[A-Z])'; + end = '(?=[,>])'; + patterns = ( + { name = 'keyword.other.directive.class.yard'; + match = '\G[A-Z]\w*(?:::[A-Z]\w*)*'; + }, + { include = "$self"; } + ); + } + ); + }; + name = { + name = 'entity.other.attribute-name.yard'; + match = '(?<=\]|\s)\b([_a-zA-Z][_a-zA-Z0-9\-]*)\b(?=\[|\s)'; + }; + list_separator = { + name = 'punctuation.separator.parameters.yard'; + match = ',\s*'; + }; + types = { + name = 'meta.array.types.yard'; + begin = '\b(\[)'; + end = '\]'; + beginCaptures = { + 1 = { name = 'entity.other.attribute-name.yard'; }; + }; + endCaptures = { 0 = { name = 'punctuation.definition.parameters.yard'; }; }; + patterns = ( + { begin = '(?=[A-Z])'; + end = '(?=[,\]])'; + patterns = ( + { name = 'keyword.other.directive.class.yard'; + match = '\G[A-Z]\w*(?:::[A-Z]\w*)*'; + }, + { include = "#array_type"; }, + { include = "$self"; } + ); + } + ); + }; + description = { + match = '(?<=\s).+?(?=\n|$)'; + }; + }; +} \ No newline at end of file