Skip to content

Commit 291053c

Browse files
committed
Update snippets
1 parent ce20f7c commit 291053c

13 files changed

+50
-41
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Get it from https://packagecontrol.io/packages/ReScript
1717
- Formatting: Command Palette (`cmd-shift-p`) -> ReScript: Format File. caveats:
1818
- Currently requires the file to be part of a ReScript project, i.e. with a `bsconfig.json`.
1919
- Cannot be a temporary file.
20+
- Snippets to ease a few syntaxes:
21+
- `external` features such as `@bs.module` and `@bs.val`
22+
- `try`, `for`, etc.
2023

2124
## Upcoming Features
2225

snippets/comment.sublime-snippet

-9
This file was deleted.

snippets/docblock.sublime-snippet

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<content><![CDATA[
3+
@val external ${1:setTimeout}: ${2:(unit => unit, int) => float} = "${3:setTimeout}"]]></content>
4+
<tabTrigger>external</tabTrigger>
5+
<scope>source.res</scope>
6+
</snippet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<content><![CDATA[
3+
@val external ${1:setTimeout}: ${2:(unit => unit, int) => float} = "${3:setTimeout}"]]></content>
4+
<tabTrigger>external</tabTrigger>
5+
<scope>source.res</scope>
6+
</snippet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<content><![CDATA[
3+
@module external ${1:leftPad}: ${2:(string, int) => string} = "${3:leftPad}"]]></content>
4+
<tabTrigger>external</tabTrigger>
5+
<scope>source.res</scope>
6+
</snippet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<content><![CDATA[
3+
@scope("${1:Math}") @val external ${2:random}: ${3:unit => float} = "${4:random}"]]></content>
4+
<tabTrigger>external</tabTrigger>
5+
<scope>source.res</scope>
6+
</snippet>

snippets/for-loop.sublime-snippet

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
for ${1:i} in ${2:startValueInclusive} to ${3:endValueInclusive} {
4+
${4:Js.log(${1:i})}
5+
}
6+
]]></content>
7+
<tabTrigger>for</tabTrigger>
8+
<scope>source.res</scope>
9+
</snippet>

snippets/for-reverse.sublime-snippet

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
for ${1:i} in ${2:startValueInclusive} downto ${3:endValueInclusive} {
4+
${4:Js.log(${1:i})}
5+
}
6+
]]></content>
7+
<tabTrigger>for</tabTrigger>
8+
<scope>source.res</scope>
9+
</snippet>

snippets/inlineComment.sublime-snippet

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<snippet>
22
<content><![CDATA[
33
module ${1:Name} = {
4-
${2:/* Module contents */}
4+
${2:// Module contents}
55
}
66
]]></content>
7-
<tabTrigger>mod</tabTrigger>
7+
<tabTrigger>module</tabTrigger>
88
<scope>source.res</scope>
99
</snippet>

snippets/switch.sublime-snippet

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<snippet>
22
<content><![CDATA[
3-
switch ${1:subject} {
4-
| ${2:option1} => ${3:expression}
5-
${4:| ${5:option2} => ${6:expression}}
3+
switch ${1:value} {
4+
| ${2:pattern1} => ${3:expression}
5+
${4:| ${5:pattern2} => ${6:expression}}
66
}
77
]]></content>
88
<tabTrigger>switch</tabTrigger>

snippets/type.sublime-snippet

-7
This file was deleted.

0 commit comments

Comments
 (0)