Skip to content

Commit 827f9eb

Browse files
committed
Add basic snippet support.
Initially supports module, handler, if and repeat blocks.
1 parent 3329711 commit 827f9eb

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 0.3.0 - Snippet support
2+
* Add basic snippets for commonly-used blocks. These work with Atom's new
3+
built-in autocomplete support.
4+
* "if" and "if … else"
5+
* "repeat"
6+
* "handler"
7+
* "module", "library" and "widget"
8+
* Minor syntax highlighting bugfix
9+
110
## 0.2.0 - Updates to LCB syntax highlighting
211
* Add detection of "metadata" and "property" declarations
312
* Add "undefined" and "the empty <x>" as language constants

snippets/language-livecode.cson

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# If you want some example snippets, check out:
22
# https://github.com/atom/language-gfm/blob/master/snippets/gfm.cson
3+
'.source.lcb':
4+
5+
'module … end module':
6+
'prefix': 'module'
7+
'body': 'module ${1:/* name */}\n\n\nend module'
8+
'library … end library':
9+
'prefix': 'library'
10+
'body': 'library ${1:/* name */}\n\n\nend library'
11+
'widget … end widget':
12+
'prefix': 'widget'
13+
'body': 'widget ${1:/* name */}\n\n\nend widget'
14+
15+
'if … end if':
16+
'prefix': 'if'
17+
'body': 'if ${1:/* condition */} then\n\t${2:/* code */}\nend if'
18+
'if … else … end if':
19+
'prefix': 'ife'
20+
'body': 'if ${1:/* condition */} then\n\t${2:/* code */}\nelse\n\t${3:/* code */}\nend if'
21+
22+
'repeat':
23+
'prefix': 'repeat'
24+
'body': 'repeat ${1:/* iterator */}\n\t${2:/*code*/}\nend repeat'
25+
26+
'handler':
27+
'prefix': 'handler'
28+
'body': 'handler ${1:/* name */}(${2:/* args */}) returns ${3:/* type */}\n\t${4:/* code */}\nend handler'

0 commit comments

Comments
 (0)