Skip to content

Commit c2f5ce1

Browse files
authored
feat(lua): lreq (local require) snippet improvement (#544)
Utilize nested placeholder to prefill the `require()` module path with the name of the local variable the module is being assigned to.
1 parent a795ca4 commit c2f5ce1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snippets/lua/lua.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"locreq": {
2323
"prefix": "lreq",
24-
"body": ["local ${1:var} = require(${2:module})"],
24+
"body": ["local ${1:module} = require(\"${2:$1}\")$0"],
2525
"description": "Require module as a variable"
2626
},
2727
"class": {

0 commit comments

Comments
 (0)