Skip to content

Commit

Permalink
auto completion of yardoc tags
Browse files Browse the repository at this point in the history
  • Loading branch information
revathskumar committed Aug 22, 2012
1 parent 380239f commit 48a61c7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
{ "keys": ["ctrl+enter"], "command": "yardoc"},
{ "keys": ["enter"], "command": "addhashtag", "context":
[
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^[ ]+\\#", "match_all": false }
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^(|[ ]+)\\#", "match_all": false },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
},
{ "keys": ["@"], "command": "run_macro_file", "args": {"file": "Packages/yardoc/yardoc-auto-complete.sublime-macro"}, "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^(|[ ]+)\\#(|[ ]+)", "match_all": false },
{ "key": "selector", "operator": "equal", "operand" : "comment", "match_all": true }
]
}
]
28 changes: 28 additions & 0 deletions ruby.sublime-completions
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"scope": "source.ruby comment",
"completions":
[
{ "trigger" : "@abstract" ,"contents": "@abstract ${1:[description]}"},
{ "trigger" : "@api","contents": "@api ${1:[description]}"},
{ "trigger" : "@attr","contents": "@attr ${1:name} [${2:type}] ${3:[description]}"},
{ "trigger" : "@attr_reader","contents": "@attr_reader [${1:type}] ${2:[description]}"},
{ "trigger" : "@attr_writer","contents": "@attr_writer [${1:type}] ${2:[description]}"},
{ "trigger" : "@author","contents": "@author ${1:[author]}"},
{ "trigger" : "@deprecated","contents": "@deprecated ${1:[description]}"},
{ "trigger" : "@example","contents": "@example ${1:[description]}"},
{ "trigger" : "@note","contents": "@note ${1:[description]}"},
{ "trigger" : "@option","contents": "@option ${1:name} [${2:type}] ${3:option_key} (${3:default_value}) ${4:[description]}"},
{ "trigger" : "@overload","contents": "@overload ${1:method}(${2:[parameters]})"},
{ "trigger" : "@param","contents": "@param [${1:type}] ${2:[description]}"},
{ "trigger" : "@private","contents": ""},
{ "trigger" : "@raise","contents": "@raise [${1:type}] ${2:[description]}"},
{ "trigger" : "@return","contents": "@return [${1:type}] ${2:[description]}"},
{ "trigger" : "@see","contents": "@see [${1:type}] ${2:[description]}"},
{ "trigger" : "@since","contents": "@since ${1:version}"},
{ "trigger" : "@todo","contents": "@todo ${1:[description]}"},
{ "trigger" : "@version","contents": "@version ${1:[description]}"},
{ "trigger" : "@yield","contents": "@yield [${1:[parameters]}] ${2:[description]}"},
{ "trigger" : "@yieldparam","contents": "@yieldparam ${1:name} [${2:type}] ${3:[description]}"},
{ "trigger" : "@yieldreturn","contents": "@yieldreturn [${1:type}] ${2:[description]}"}
]
}
4 changes: 4 additions & 0 deletions yardoc-auto-complete.sublime-macro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{"command": "insert_snippet", "args": {"contents": "@"}},
{"command": "auto_complete"}
]

0 comments on commit 48a61c7

Please sign in to comment.