Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

Snippets improvements #5

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions snippets/ava.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<snippet>
<content><![CDATA[
import test from 'ava';
import $1 from '$2';
import $1 from ${2:'${1/([A-Z])/-\l$1/g}'};

test('${3:title}', t => {
test(${3/(.+)|.*/?1:'/}${3:title}${3/(.+)|.*/?1:', /}t => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the |.* part really needed? If yes, what purpose does it have? I might be missing something obvious since it's late here, but seems to be working fine without.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hell no! Tiredness make me write unecessary complicated patterns. As you will see in the next commit, the final regex is wayyyy simpler. Thank you.

t.is($1(), '$4');
});
]]></content>
Expand Down
2 changes: 1 addition & 1 deletion snippets/test-async.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
test('${1:title}', async t => {
test(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}async t => {
$2
});
]]></content>
Expand Down
2 changes: 1 addition & 1 deletion snippets/test-cb.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
test.cb('${1:title}', t => {
test.cb(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}t => {
$2
});
]]></content>
Expand Down
2 changes: 1 addition & 1 deletion snippets/test-serial.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
test.serial('${1:title}', t => {
test.serial(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}, t => {
$2
});
]]></content>
Expand Down
2 changes: 1 addition & 1 deletion snippets/test.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
test('${1:title}', t => {
test(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}t => {
$2
});
]]></content>
Expand Down