-
Notifications
You must be signed in to change notification settings - Fork 7
/
Clips.json
201 lines (201 loc) · 5.7 KB
/
Clips.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
{
"clips": [
{
"name": "ERB",
"children": [
{
"content": "<% $0 %>",
"name": "ERB expression",
"scope": "editor",
"shortcut": "ctrl-x",
"syntax": "html+erb",
"trigger": "<%"
},
{
"content": "<%= $0 %>",
"name": "ERB insert",
"scope": "editor",
"shortcut": "ctrl-z",
"syntax": "html+erb",
"trigger": "<%="
}
]
},
{
"name": "Rails",
"children": [
{
"content": "module $0\n\textend ActiveSupport::Concern\n\n\t$1\nend",
"name": "concern",
"scope": "editor",
"syntax": "ruby",
"trigger": "concern"
},
{
"content": "params[:${:id}]",
"name": "params",
"scope": "editor",
"shortcut": "ctrl-p",
"syntax": "ruby",
"trigger": "params"
},
{
"content": "test \"$0\" do\n\t$1\nend",
"name": "test case",
"scope": "editor",
"syntax": "ruby",
"trigger": "test"
}
]
},
{
"name": "Ruby",
"children": [
{
"content": "{ |${0:e}| $1 ",
"name": "block",
"scope": "editor",
"syntax": "ruby",
"trigger": "{"
},
{
"content": "do\n\t$0\nend",
"name": "do",
"scope": "editor",
"syntax": "ruby",
"trigger": "do"
},
{
"content": "do |$0|\n\t$1\nend",
"name": "do (yield)",
"scope": "editor",
"syntax": "ruby",
"trigger": "doo"
},
{
"content": "def $0\n\t$1\nend",
"name": "New method",
"scope": "editor",
"shortcut": "command-option-return",
"syntax": "ruby",
"trigger": "def"
}
]
},
{
"name": "Stimulus (HTML)",
"children": [
{
"content": "data-controller=\"${:controller-identifier}\"",
"name": "Stimulus Controller",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus controller"
},
{
"content": "data-action=\"${:event}->${:controller-identifier}#${:actionName}\"",
"name": "Stimulus Action",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus action"
},
{
"content": "data-action=\"${:event}->${:controller-identifier}#${:actionName}:${:option}\"",
"name": "Stimulus Action + Option",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus action option"
},
{
"content": "data-${:controller-identifier}-${:param-name}-param=\"${:param}\"",
"name": "Stimulus Param",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus param"
},
{
"content": "data-${:controller-identifier}-target=\"${:targetName}\"",
"name": "Stimulus Target",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus target"
},
{
"content": "data-${:controller-identifier}-${:outlet-name}-target=\"${:css-selector}\"",
"name": "Stimulus Outlet",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus outlet"
},
{
"content": "data-${:controller-identifier}-${:value-name}-value=\"${:value}\"",
"name": "Stimulus Value",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus value"
},
{
"content": "data-${:controller-identifier}-${:class-name}-class=\"${:css-class}\"",
"name": "Stimulus Class",
"scope": "editor",
"syntax": "html",
"trigger": "stimulus class"
}
]
},
{
"name": "Stimulus (JS)",
"children": [
{
"content": "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n\t${:Code}\n}",
"name": "Stimulus Controller",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus controller"
},
{
"content": "static targets = [\"${:targetName}\"]",
"name": "Stimulus Targets",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus targets"
},
{
"content": "static outlets = [\"${:outletName}\"]",
"name": "Stimulus Outlets",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus outlets"
},
{
"content": "static values = {\n\t${:valueName}: ${:Type}\n}",
"name": "Stimulus Values",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus values"
},
{
"content": "static values = {\n\t${:valueName}: {\n\t\ttype: ${:Type},\n\t\tdefault: ${:value}\n\t}\n}",
"name": "Stimulus Values + Defaults",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus values defaults"
},
{
"content": "static classes = [\"${:className}\"]",
"name": "Stimulus Classes",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus classes"
},
{
"content": "this.dispatch(\"${:eventName}\", { detail: ${:payloadObject} })",
"name": "Stimulus Dispatch",
"scope": "editor",
"syntax": "javascript",
"trigger": "stimulus dispatch"
}
]
}
]
}