From 8fe23e7b71b408c476bc3f9ffb2aa5d75507f4f2 Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Sat, 3 Aug 2024 23:15:24 +1200 Subject: [PATCH 1/2] add "Define Plugin with Settings" snippet --- snippets/ts.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/snippets/ts.json b/snippets/ts.json index 8cf1435..ad361ef 100644 --- a/snippets/ts.json +++ b/snippets/ts.json @@ -12,5 +12,32 @@ " authors: [Devs.${3:author}],", "});" ] + }, + "Define Plugin with Settings": { + "prefix": [ + "defPluginWithSettings", + "vcPluginWithSettings" + ], + "description": "Defines a Vencord Plugin with Settings", + "body": [ + "import { definePluginSettings } from \"@api/Settings\";", + "import { Devs } from \"@utils/constants\";", + "import definePlugin, { OptionType } from \"@utils/types\";", + "", + "const settings = definePluginSettings({", + " ${4:yourSetting}: {", + " description: \"${5:description}\",", + " type: OptionType.${6:BOOLEAN},", + " default: ${7:true},", + " }", + "});", + "", + "export default definePlugin({", + " name: \"${1:name}\",", + " description: \"${2:description}\",", + " authors: [Devs.${3:author}],", + " settings,", + "});" + ] } } From ce44a7e4d466f2476fde4beed08ca5f766e23d57 Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Sat, 3 Aug 2024 23:18:26 +1200 Subject: [PATCH 2/2] Change default setting name in "Define Plugin with Settings" snippet --- snippets/ts.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ts.json b/snippets/ts.json index ad361ef..2a99921 100644 --- a/snippets/ts.json +++ b/snippets/ts.json @@ -25,7 +25,7 @@ "import definePlugin, { OptionType } from \"@utils/types\";", "", "const settings = definePluginSettings({", - " ${4:yourSetting}: {", + " ${4:settingName}: {", " description: \"${5:description}\",", " type: OptionType.${6:BOOLEAN},", " default: ${7:true},",