123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- {
- // Place your snippets for lua here. Each snippet is defined under a snippet name and has a prefix, body and
- // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
- // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
- // same ids are connected.
- // Example:
- // "Print to console": {
- // "prefix": "log",
- // "body": [
- // "console.log('$1');",
- // "$2"
- // ],
- // "description": "Log output to console"
- // }
- "Create a path variable": {
- "prefix": "p",
- "body": [
- "local ${1:pathname} = ${2:basepath}.${1}"
- ]
- },
- "Require a library from a variable": {
- "prefix": "rv",
- "body": [
- "local ${1:ModuleName} = require(${2:variable})"
- ]
- },
- "Require a library from a path": {
- "prefix": "r",
- "body": [
- "local ${1:ModuleName} = require(${2:path}.${1})"
- ]
- },
- "Globals used by most scripts": {
- "prefix": "g",
- "body": [
- "local ReplicatedStorage = game:GetService(\"ReplicatedStorage\")",
- "",
- "local common = ReplicatedStorage.common",
- "local lib = ReplicatedStorage.lib",
- "",
- ]
- },
- "Players service": {
- "prefix": "ps",
- "body": [
- "local Players = game:GetService(\"Players\")",
- "",
- ]
- },
- "LocalPlayer": {
- "prefix": "lp",
- "body": [
- "local LocalPlayer = Players.LocalPlayer",
- "",
- ]
- },
- ":WaitForChild(...)": {
- "prefix": "wfc",
- "body": [
- ":WaitForChild(\"${1:child}\")"
- ]
- },
- ":FindFirstChild(...)": {
- "prefix": "ffc",
- "body": [
- ":FindFirstChild(\"${1:child}\")"
- ]
- },
- "Create a new instance variable with :WaitForChild": {
- "prefix": "iwfc",
- "body": [
- "local ${1:identifier} = ${2:basepath}:WaitForChild(\"${3:child}\")"
- ]
- },
- "Create a new instance variable with :FindFirstChild": {
- "prefix": "iffc",
- "body": [
- "local ${1:identifier} = ${2:basepath}:FindFirstChild(\"${3:child}\")"
- ]
- },
- "Require Roact": {
- "prefix": "rct",
- "body": [
- "local Roact = require(lib.Roact)",
- "",
- ]
- },
- "Require Rodux": {
- "prefix": "rdx",
- "body": [
- "local Rodux = require(lib.Rodux)",
- "",
- ]
- },
- "Require RoactRodux": {
- "prefix": "rctrdx",
- "body": [
- "local RoactRodux = require(lib.RoactRodux)",
- "",
- ]
- },
- "Create stateful component": {
- "prefix": "rcc",
- "body": [
- "local ${1:MyComponent} = Roact.Component:extend(\"${1}\")",
- "",
- "function ${1}:init()",
- "end",
- "",
- "function ${1}:didMount()",
- "end",
- "",
- "function ${1}:render()",
- "\t$0",
- "end",
- "",
- "return ${1}"
- ]
- },
- }
|