@@ -9,7 +9,7 @@ on mouseUp
99 if the short name of the target is "Generate Snippets" then
1010 put "# GENERATED SNIPPETS START" & cr & \
1111 "'.source.livecodescript':" & cr & \
12- tab & "autocomplete:" & cr & \
12+ tab & "autocomplete:" & cr & \
1313 tab & tab & "symbols:" & cr & \
1414 tab & tab & tab & "builtins:" & cr & \
1515 tab & tab & tab & tab & "suggestions: [" into theSnippets
@@ -24,21 +24,21 @@ on mouseUp
2424 delete word 1 of theSyntax
2525 replace "[" with empty in theSyntax
2626 replace "]" with empty in theSyntax
27-
27+
2828 -- parameters
2929 put empty into theFunctionName
3030 put empty into theParameters
3131 if theSyntax contains "(" then
3232 get MatchText (theSyntax ,"(?i)^(.*)\((.*)\)" ,theFunctionName ,theParameters )
33-
33+
3434 if theParameters is empty then
3535 next repeat
3636 end if
37-
37+
3838 put theFunctionName into thePrefix
39-
39+
4040 put theFunctionName & "(" into theBody
41-
41+
4242 if theParameters is not empty then
4343 replace "<" with "" in theParameters
4444 replace ">" with "" in theParameters
@@ -52,11 +52,11 @@ on mouseUp
5252 else
5353 put ")" after theBody
5454 end if
55-
55+
5656 AddSnippet theSnippets , theFunctionName , theBody , "function" , theDescription , theFile
57-
57+
5858 else
59-
59+
6060 if theSyntax contains "of" then
6161 put word 2 to - 4 of theSyntax into theOptions
6262 put word - 3 of theSyntax into theFunctionName
@@ -69,7 +69,7 @@ on mouseUp
6969 put word 2 to - 2 of theSyntax into theOptions
7070 put word - 1 of theSyntax into theFunctionName
7171 end if
72-
72+
7373 if theOptions contains "|" then
7474 split theOptions with "|"
7575 repeat with theIndex = 1 to the number of elements of theOptions
@@ -88,7 +88,7 @@ on mouseUp
8888 end if
8989 end repeat
9090 end repeat
91-
91+
9292 # messages
9393 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/message"
9494 repeat for each line theFile in the files
@@ -117,12 +117,12 @@ on mouseUp
117117 if the last char of theSyntax is comma then
118118 delete the last char of theSyntax
119119 end if
120-
120+
121121 put theSyntax & cr & tab & "${1:/* code */ }" & cr & "end" && theMessageName into theBody
122122 AddSnippet theSnippets , theMessageName & " ... end " & theMessageName , theBody , "message" , theDescription , theFile
123123 end repeat
124124 end repeat
125-
125+
126126 # properties
127127 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/property"
128128 repeat for each line theFile in the files
@@ -143,12 +143,12 @@ on mouseUp
143143 repeat with theIndex = 2 to the number of items of theSnippet
144144 put theIndex - 1 & ":" before item theIndex of theSnippet
145145 end repeat
146-
147-
146+
147+
148148 AddSnippet theSnippets , theSyntax , theSnippet , "property" , theDescription , theFile
149149 end repeat
150150 end repeat
151-
151+
152152 # keywords
153153 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/keyword"
154154 repeat for each line theFile in the files
@@ -163,7 +163,7 @@ on mouseUp
163163 AddSnippet theSnippets , theSyntax , theSyntax , "keyword" , theDescription , theFile
164164 end repeat
165165 end repeat
166-
166+
167167 # constants
168168 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/constant"
169169 repeat for each line theFile in the files
@@ -176,7 +176,7 @@ on mouseUp
176176 AddSnippet theSnippets , theSyntax , theSyntax , "constant" , theDescription , theFile
177177 end repeat
178178 end repeat
179-
179+
180180 # objects
181181 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/object"
182182 repeat for each line theFile in the files
@@ -189,7 +189,7 @@ on mouseUp
189189 AddSnippet theSnippets , theSyntax , theSyntax , "object" , theDescription , theFile
190190 end repeat
191191 end repeat
192-
192+
193193 # operators
194194 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/operator"
195195 repeat for each line theFile in the files
@@ -229,7 +229,7 @@ on mouseUp
229229 end repeat
230230 end repeat
231231 end repeat
232-
232+
233233 # commands
234234 set the folder to specialFolderPath ("home" ) & "/livecode/docs/dictionary/command"
235235 repeat for each line theFile in the files
@@ -248,7 +248,7 @@ on mouseUp
248248 replace ">" with "" in theSyntax
249249 put word 1 to 3 of theSyntax into thePrefix
250250 replace space with empty in thePrefix
251-
251+
252252 split theParameters with "<"
253253 repeat with theIndex = 1 to the number of elements of theParameters
254254 if theIndex is 1 then
@@ -262,10 +262,10 @@ on mouseUp
262262 end repeat
263263 end repeat
264264 end repeat
265-
265+
266266 put cr & tab & tab & tab & tab & "]" & cr & \
267267 "# GENERATED SNIPPETS END" & cr after theSnippets
268-
268+
269269 put url ("binfile:" & specialFolderPath ("home" )& "/atom-language-livecode/settings/language-livecode.cson" ) into theCSON
270270 put offset ("# GENERATED SNIPPETS START" ,theCSON ) into theStart
271271 put offset ("# GENERATED SNIPPETS END" ,theCSON ) into theEnd
@@ -389,35 +389,35 @@ command AddSnippet @pSnippets, pName, pBody, pType, pDescription, pFile
389389 if pName ends with space then
390390 delete the last char of pName
391391 end if
392-
392+
393393 put tab & tab & tab & tab & tab into tTabLevel
394-
394+
395395 put tTabLevel & "{" & cr into theSnippet
396-
396+
397397 replace quote with "\" & quote in pBody
398-
398+
399399 if the number of lines of pBody > 1 then
400400 put "'''" & cr before pBody
401401 put cr & "'''" after pBody
402-
402+
403403 repeat with theIndex = 2 to the number of lines of pBody
404404 put tTabLevel & tab before line theIndex of pBody
405405 end repeat
406406 else
407407 put "'" & pBody & "'" into pBody
408408 end if
409-
409+
410410 # I assume this is based on the lcdoc filename... hope so
411411 set the itemDelimiter to "."
412412 put "https://livecode.com/resources/api/#livecode_script/" & item 1 of pFile into theMoreURL
413-
413+
414414 put tTabLevel & tab & "type: '" & pType & "'" & cr after theSnippet
415415 put tTabLevel & tab & "snippet: " & pBody & cr after theSnippet
416416 put tTabLevel & tab & "description: '" & pDescription & "'" & cr after theSnippet
417417 put tTabLevel & tab & "descriptionMoreURL: '" & theMoreURL & "'" & cr after theSnippet
418-
418+
419419 put tTabLevel & "}" after theSnippet
420-
420+
421421 put cr & theSnippet after pSnippets
422-
422+
423423end AddSnippet
0 commit comments