I broke up with neovim....vim is my best friend now

This commit is contained in:
LinlyBoi
2023-04-30 08:14:07 +03:00
parent 0d185449c5
commit 4a4a6b1e81
5245 changed files with 468325 additions and 25 deletions

View File

@@ -0,0 +1,108 @@
{
"adminview": {
"prefix": "adminview",
"body": [
"@admin.register(${1})",
"class ${1}Admin(admin.ModelAdmin):",
"\t'''Admin View for ${1}'''",
"",
"\tlist_display = ('${2}',)",
"\tlist_filter = ('${3}',)",
"\tinlines = [",
"\t\t${4}Inline,",
"\t]",
"\traw_id_fields = ('${5}',)",
"\treadonly_fields = ('${6}',)",
"\tsearch_fields = ('${7}',)",
"\tdate_hierarchy = '${8}'",
"\tordering = ('${9}',)"
],
"description": "Model Admin View",
"scope": "source.python"
},
"stackedinline": {
"prefix": "stackedinline",
"body": [
"class ${1}Inline(admin.StackedInline):",
"\t'''Stacked Inline View for ${1}'''",
"",
"\tmodel = ${2:${1}}",
"\tmin_num = ${3:3}",
"\tmax_num = ${4:20}",
"\textra = ${5:1}",
"\traw_id_fields = (${6},)"
],
"description": "Stacked Inline",
"scope": "source.python"
},
"tabularinline": {
"prefix": "tabularinline",
"body": [
"class ${1}Inline(admin.TabularInline):",
"\t'''Tabular Inline View for ${1}'''",
"",
"\tmodel = ${2:${1}}",
"\tmin_num = ${3:3}",
"\tmax_num = ${4:20}",
"\textra = ${5:1}",
"\traw_id_fields = (${6},)"
],
"description": "Tabular Inline",
"scope": "source.python"
},
"simplelistfilter": {
"prefix": "simplelistfilter",
"body": [
"class ${1:NAME}Filter(admin.SimpleListFilter):",
"",
"\ttitle = '$2'",
"\tparameter_name = '$0'",
"",
"\tdef lookups(self, request, model_admin):",
"\t\tpass",
"",
"\tdef queryset(self, request, queryset):",
"\t\treturn queryset"
],
"description": "Admin SimpleList Filter",
"scope": "source.python"
},
"iadmin": {
"prefix": "iadmin",
"body": "from django.contrib import admin",
"description": "from ... import admin",
"scope": "source.python"
},
"iadminsite": {
"prefix": "iadminsite",
"body": "from django.contrib.admin import AdminSite",
"description": "from ... import AdminSite",
"scope": "source.python"
},
"register": {
"prefix": "register",
"body": "admin.site.register($1)",
"description": "register the model class without providing a ModelAdmin description.",
"scope": "source.python"
},
"registermadmin": {
"prefix": "registermadmin",
"body": "admin.site.register($1, $1Admin)",
"description": "register the model class providing a ModelAdmin description",
"scope": "source.python"
},
"fieldsets": {
"prefix": "fieldsets",
"body": [
"fieldsets = (",
"\t(None, {",
"\t\t'fields': (",
"\t\t\t$1",
"\t\t),",
"\t}),",
")"
],
"description": "",
"scope": "source.python"
}
}

View File

@@ -0,0 +1,201 @@
{
"DRF Serializer (class)": {
"prefix": "serializer",
"body": [
"class ${1:Name}Serializer(serializers.Serializer):",
"\t${2}"
],
"description": "Django-rest Serializers ``Serializer`` Class"
},
"DRF ModelSerializer (class)": {
"prefix": "modelserializer",
"body": [
"class ${1:Name}ModelSerializer(serializers.ModelSerializer):",
"\t${2}",
"\tclass Meta:",
"\t\tmodel = ${3:$1}",
"\t\tfields = \"${4:__all__}\""
],
"description": "Django-rest Serializers ``ModelSerializer`` Class"
},
"DRF Create (serializers-method)": {
"prefix": "screate",
"body": [
"def create(self, validated_data):",
"\treturn ${1:super().create(validated_data)}"
],
"description": "Django-rest Serializers ``Create`` Method"
},
"DRF Update (serializers-method)": {
"prefix": "supdate",
"body": [
"def update(self, instance, validated_data):",
"\treturn ${1:super().update(instance, validated_data)}"
],
"description": "Django-rest Serializers ``Update`` Method"
},
"DRF BooleanField": {
"prefix": "sbool",
"body": "${1:FIELDNAME} = serializers.BooleanField(${2})",
"description": "Django-rest Serializers ``BooleanField``"
},
"DRF CharField": {
"prefix": "schar",
"body": "${1:FIELDNAME} = serializers.CharField(${2})",
"description": "Django-rest Serializers ``CharField``"
},
"DRF DateField": {
"prefix": "sdate",
"body": "${1:FIELDNAME} = serializers.DateField(${2})",
"description": "Django-rest Serializers ``DateField``"
},
"DRF DateTimeField": {
"prefix": "sdatetime",
"body": "${1:FIELDNAME} = serializers.DateTimeField(${2})",
"description": "Django-rest Serializers ``DateTimeField``"
},
"DRF DecimalField": {
"prefix": "sdecimal",
"body": "${1:FIELDNAME} = serializers.DecimalField(max_digits=${2}, decimal_places=${3})",
"description": "Django-rest Serializers ``DecimalField``"
},
"DRF DictField": {
"prefix": "sdict",
"body": "${1:FIELDNAME} = serializers.DictField(child=${2})",
"description": "Django-rest Serializers ``DictField``"
},
"DRF DurationField": {
"prefix": "sduration",
"body": "${1:FIELDNAME} = serializers.DurationField(${2})",
"description": "Django-rest Serializers ``DurationField``"
},
"DRF EmailField": {
"prefix": "semail",
"body": "${1:FIELDNAME} = serializers.EmailField(${2})",
"description": "Django-rest Serializers ``EmailField``"
},
"DRF FileField": {
"prefix": "sfile",
"body": "${1:FIELDNAME} = serializers.FileField(${2})",
"description": "Django-rest Serializers ``FileField``"
},
"DRF FilePathField": {
"prefix": "sfilepath",
"body": "${1:FIELDNAME} = serializers.FilePathField(path=${2})",
"description": "Django-rest Serializers ``FilePathField``"
},
"DRF FloatField": {
"prefix": "sfloat",
"body": "${1:FIELDNAME} = serializers.FloatField(${2})",
"description": "Django-rest Serializers ``FloatField``"
},
"DRF HiddenField": {
"prefix": "shidden",
"body": "${1:FIELDNAME} = serializers.HiddenField(${2})",
"description": "Django-rest Serializers ``HiddenField``"
},
"DRF HyperlinkedRelatedField": {
"prefix": "shyperlinkrelated",
"body": "${1:FIELDNAME} = serializers.HyperlinkedRelatedField(${2})",
"description": "Django-rest Serializers ``HyperlinkedRelatedField``"
},
"DRF ImageField": {
"prefix": "simg",
"body": "${1:FIELDNAME} = serializers.ImageField(${2})",
"description": "Django-rest Serializers ``ImageField``"
},
"DRF IntegerField": {
"prefix": "sint",
"body": "${1:FIELDNAME} = serializers.IntegerField(${2})",
"description": "Django-rest Serializers ``IntegerField``"
},
"DRF IPAddressField": {
"prefix": "sip",
"body": "${1:FIELDNAME} = serializers.IPAddressField(${2})",
"description": "Django-rest Serializers ``IPAddressField``"
},
"DRF JSONField": {
"prefix": "sjson",
"body": "${1:FIELDNAME} = serializers.JSONField(binary=${2})",
"description": "Django-rest Serializers ``JSONField``"
},
"DRF ListField": {
"prefix": "slist",
"body": "${1:FIELDNAME} = serializers.ListField(child=${2})",
"description": "Django-rest Serializers ``ListField``"
},
"DRF ModelField": {
"prefix": "smodel",
"body": "${1:FIELDNAME} = serializers.ModelField(model_field=${2})",
"description": "Django-rest Serializers `ModelField``"
},
"DRF ChoiceField": {
"prefix": "schoice",
"body": "${1:FIELDNAME} = serializers.ChoiceField(choices={${2}})",
"description": "Django-rest Serializers ``ChoiceField``"
},
"DRF MultipleChoiceField": {
"prefix": "smchoice",
"body": "${1:FIELDNAME} = serializers.MultipleChoiceField(choices=${2})",
"description": "Django-rest Serializers ``MultipleChoiceField``"
},
"DRF NullBooleanField": {
"prefix": "snullbool",
"body": "${1:FIELDNAME} = serializers.NullBooleanField(${2})",
"description": "Django-rest Serializers ``NullBooleanField``"
},
"DRF PrimaryKeyRelatedField": {
"prefix": "spkr",
"body": "${1:FIELDNAME} = serializers.PrimaryKeyRelatedField(${2})",
"description": "Django-rest Serializers ``PrimaryKeyRelatedField``"
},
"DRF ReadOnlyField": {
"prefix": "sreadonly",
"body": "${1:FIELDNAME} = serializers.ReadOnlyField(${2})",
"description": "Django-rest Serializers ``ReadOnlyField``"
},
"DRF RegexField": {
"prefix": "sregex",
"body": "${1:FIELDNAME} = serializers.RegexField(regex=${2})",
"description": "Django-rest Serializers `RegexField``"
},
"DRF SerializerMethodField": {
"prefix": "ssmethod",
"body": [
"${1:FIELDNAME} = serializers.SerializerMethodField(${2})",
"def get_$1(self, object):",
"\treturn"
],
"description": "Django-rest Serializers ``SerializerMethodField``"
},
"DRF SlugField": {
"prefix": "sslug",
"body": "${1:FIELDNAME} = serializers.SlugField(${2})",
"description": "Django-rest Serializers ``SlugField``"
},
"DRF SlugRelatedField": {
"prefix": "sslugrelated",
"body": "${1:FIELDNAME} = serializers.SlugRelatedField(${2})",
"description": "Django-rest Serializers ``SlugRelatedField``"
},
"DRF StringRelatedField": {
"prefix": "ssr",
"body": "${1:FIELDNAME} = serializers.StringRelatedField(${2})",
"description": "Django-rest Serializers ``StringRelatedField``"
},
"DRF TimeField": {
"prefix": "stime",
"body": "${1:FIELDNAME} = serializers.TimeField(${2})",
"description": "Django-rest Serializers ``TimeField``"
},
"DRF URLField": {
"prefix": "surl",
"body": "${1:FIELDNAME} = serializers.URLField(${2})",
"description": "Django-rest Serializers ``URLField``"
},
"DRF UUIDField": {
"prefix": "suuid",
"body": "${1:FIELDNAME} = serializers.UUIDField(${2})",
"description": "Django-rest Serializers ``UUIDField``"
}
}

View File

@@ -0,0 +1,153 @@
{
"DRF ApiView": {
"prefix": "apiview",
"body": [
"class ${1:Name}APIView(APIView):",
"\t${2}"
],
"description": "Django-rest Views ``ApiView`` Class"
},
"DRF CreateApiView": {
"prefix": "createapiview",
"body": [
"class ${1:Name}CreateApiView(generics.CreateApiView):",
"\tserializer_class = ${2:$1Serializer}"
],
"description": "Django-rest Views ``CreateApi`` Class"
},
"DRF DestoryApiView": {
"prefix": "destoryapiview",
"body": [
"class ${1:Name}DestoryApiView(generics.DestoryApiView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``DestoryApiView`` Class"
},
"DRF ListApiView": {
"prefix": "listapiview",
"body": [
"class ${1:Name}ListApiView(generics.ListApiView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``ListApiView`` Class"
},
"DRF ListCreateApiView": {
"prefix": "listcreateapiview",
"body": [
"class ${1:Name}ListCreateApiView(generics.ListCreateApiView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``ListCreateApiView`` Class"
},
"DRF RetrieveAPIView": {
"prefix": "retrieveapiview",
"body": [
"class ${1:Name}RetrieveAPIView(generics.RetrieveAPIView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``RetrieveAPIView`` Class"
},
"DRF RetrieveDestroyAPIView": {
"prefix": "retrievedestoryapiview",
"body": [
"class ${1:Name}RetrieveDestroyAPIView(generics.RetrieveDestroyAPIView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``RetrieveDestroyAPIView`` Class"
},
"DRF RetrieveUpdateAPIView": {
"prefix": "retrieveupdateapiview",
"body": [
"class ${1:Name}RetrieveUpdateAPIView(generics.RetrieveUpdateAPIView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``RetrieveUpdateAPIView`` Class"
},
"DRF RetrieveUpdateDestoryAPIView": {
"prefix": "retrieveupdatedestoryapiview",
"body": [
"class ${1:Name}RetrieveUpdateDestoryAPIView(generics.RetrieveUpdateDestoryAPIView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``RetrieveUpdateDestoryAPIView`` Class"
},
"DRF UpdateApiView": {
"prefix": "updateapiview",
"body": [
"class ${1:Name}UpdateApiView(generics.UpdateApiView):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``UpdateApiView`` Class"
},
"DRF perform_create": {
"prefix": "performcreate",
"body": [
"def perform_create(self, serializer):",
"\treturn ${1:super().perform_create(serializer)}"
],
"description": "Django-rest Views ``perform_create`` method"
},
"DRF perform_update": {
"prefix": "perfromupdate",
"body": [
"def perform_create(self, serializer):",
"\treturn ${1:super().perform_create(serializer)}"
],
"description": "Django-rest Views ``perform_create`` method"
},
"DRF perform_destory": {
"prefix": "performdestory",
"body": [
"def perform_ddestory(self, instance):",
"\treturn ${1:super().perform_destory(instance)}"
],
"description": "Django-rest Views ``perform_create`` method"
},
"DRF ModelViewSet": {
"prefix": "modelviewset",
"body": [
"class ${1:Name}ModelViewSet(viewsets.ModelViewSet):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``ModelViewSet`` Class"
},
"DRF ReadOnlyModelViewSet": {
"prefix": "readonlymodelviewset",
"body": [
"class ${1:Name}ReadOnlyModelViewSet(viewsets.ReadOnlyModelViewSet):",
"\tserializer_class = ${2:$1Serializer}",
"\tqueryset = $1.objects.filter(${3})"
],
"description": "Django-rest Views ``ReadOnlyModelViewSet`` Class"
},
"DRF ViewSet": {
"prefix": "viewset",
"body": [
"class ${1:Name}ViewSet(viewsets.ViewSet):",
"\tdef list(self, request):",
"\t\tpass",
"\tdef create(self, request):",
"\t\tpass",
"\tdef retrieve(self, request, pk=None):",
"\t\tpass",
"\tdef update(self, request, pk=None):",
"\t\tpass",
"\tdef partial_update(self, request, pk=None):",
"\t\tpass",
"\tdef destroy(self, request, pk=None):",
"\t\tpass"
],
"description": "Django-rest Views ``ViewSet`` Class"
}
}

View File

@@ -0,0 +1,287 @@
{
"Form": {
"prefix": "Form",
"body": [
"class ${1:FORMNAME}(forms.Form):",
"\t\"\"\"${2:$1 definition}.\"\"\"",
"",
"\t${3:# TODO: Define form fields here}",
""
],
"description": "Form",
"scope": "source.python"
},
"ModelForm": {
"prefix": "ModelForm",
"body": [
"class ${1:MODELNAME}Form(forms.ModelForm):",
"\t\"\"\"${2:Form definition for $1}.\"\"\"",
"",
"\tclass Meta:",
"\t\t\"\"\"Meta definition for ${1}form.\"\"\"",
"",
"\t\tmodel = $1",
"\t\tfields = ('$3',)",
""
],
"description": "ModelForm",
"scope": "source.python"
},
"fbool": {
"prefix": "fbool",
"body": "${1:FIELDNAME} = forms.BooleanField($2, required=${3:False})",
"description": "BooleanField (fbool)",
"scope": "source.python"
},
"fchar": {
"prefix": "fchar",
"body": "${1:FIELDNAME} = forms.CharField($2,${3: max_length=$4,} required=${5:False})",
"description": "CharField (fchar)",
"scope": "source.python"
},
"fchoice": {
"prefix": "fchoice",
"body": "${1:FIELDNAME} = forms.ChoiceField($2, choices=[${3:CHOICES}], required=${4:False})",
"description": "ChoiceField (fchoice)",
"scope": "source.python"
},
"fcombo": {
"prefix": "fcombo",
"body": "${1:FIELDNAME} = forms.ComboField($2)",
"description": "ComboField (fcombo)",
"scope": "source.python"
},
"fdate": {
"prefix": "fdate",
"body": "${1:FIELDNAME} = forms.DateField($2, required=${3:False})",
"description": "DateField (fdate)",
"scope": "source.python"
},
"fdatetime": {
"prefix": "fdatetime",
"body": "${1:FIELDNAME} = forms.DateTimeField($2, required=${3:False})",
"description": "DateTimeField (fdatetime)",
"scope": "source.python"
},
"fdecimal": {
"prefix": "fdecimal",
"body": "${1:FIELDNAME} = forms.DecimalField($2, required=${3:False})",
"description": "DecimalField (fdecimal)",
"scope": "source.python"
},
"fduration": {
"prefix": "fduration",
"body": "${1:FIELDNAME} = forms.DurationField($2, required=${3:False})",
"description": "DurationField (fduration)",
"scope": "source.python"
},
"femail": {
"prefix": "femail",
"body": "${1:FIELDNAME} = forms.EmailField($2, required=${3:False})",
"description": "EmailField (femail)",
"scope": "source.python"
},
"ffile": {
"prefix": "ffile",
"body": "${1:FIELDNAME} = forms.FileField($2,${3: max_length=$4,} required=${5:False})",
"description": "FileField (ffile)",
"scope": "source.python"
},
"ffilepath": {
"prefix": "ffilepath",
"body": "${1:FIELDNAME} = forms.FilePathField($2, path=${3:/absolute_path/}, required=${4:False})",
"description": "FilePathField (ffilepath)",
"scope": "source.python"
},
"ffloat": {
"prefix": "ffloat",
"body": "${1:FIELDNAME} = forms.FloatField($2, required=${3:False})",
"description": "FloatField (ffloat)",
"scope": "source.python"
},
"fip": {
"prefix": "fip",
"body": "${1:FIELDNAME} = forms.IPAddressField($2)",
"description": "IPAddressField (fip).\n\nThis field has been deprecated since version 1.7 in favor of GenericIPAddressField.\n\n",
"scope": "source.python"
},
"fgenericip": {
"prefix": "fip",
"body": "${1:FIELDNAME} = forms.GenericIPAddressField($2)",
"description": "IPAddressField (fgenericip)",
"scope": "source.python"
},
"fimg": {
"prefix": "fimg",
"body": "${1:FIELDNAME} = forms.ImageField($2, required=${3:False})",
"description": "ImageField (fimg)",
"scope": "source.python"
},
"fint": {
"prefix": "fint",
"body": "${1:FIELDNAME} = forms.IntegerField($2, required=${3:False})",
"description": "IntegerField (fint)",
"scope": "source.python"
},
"fmochoice": {
"prefix": "fmochoice",
"body": "${1:FIELDNAME} = forms.ModelChoiceField($2)",
"description": "ModelChoiceField (fmochoice)",
"scope": "source.python"
},
"fmomuchoice": {
"prefix": "fmomuchoice",
"body": "${1:FIELDNAME} = forms.ModelMultipleChoiceField($2)",
"description": "ModelMultipleChoiceField (fmomuchoice)",
"scope": "source.python"
},
"fmuval": {
"prefix": "fmuval",
"body": "${1:FIELDNAME} = forms.MultiValueField($2)",
"description": "MultiValueField (fmuval)",
"scope": "source.python"
},
"fmuchoice": {
"prefix": "fmuchoice",
"body": "${1:FIELDNAME} = forms.MultipleChoiceField($2, choices=[${3:CHOICES}], required=${4:False})",
"description": "MultipleChoiceField (fmuchoice)",
"scope": "source.python"
},
"ftypedmuchoice": {
"prefix": "ftypedmuchoice",
"body": "${1:FIELDNAME} = forms.TypedMultipleChoiceField($2, choices=[${3:CHOICES}], coerce=${4:TYPE}, required=${5:False})",
"description": "TypedMultipleChoiceField (ftypedmuchoice)",
"scope": "source.python"
},
"fnullbool": {
"prefix": "fnullbool",
"body": "${1:FIELDNAME} = forms.NullBooleanField($2, required=${3:False})",
"description": "NullBooleanField (fnullbool)",
"scope": "source.python"
},
"fregex": {
"prefix": "fregex",
"body": "${1:FIELDNAME} = forms.RegexField($2, regex=${3:REGEX}, required=${4:False})",
"description": "RegexField (fregex)",
"scope": "source.python"
},
"fslug": {
"prefix": "fslug",
"body": "${1:FIELDNAME} = forms.SlugField($2, allow_unicode=${3:False}, required=${4:False})",
"description": "SlugField (fslug)",
"scope": "source.python"
},
"fsdatetime": {
"prefix": "fsdatetime",
"body": "${1:FIELDNAME} = forms.SplitDateTimeField($2)",
"description": "SplitDateTimeField (fsdatetime)",
"scope": "source.python"
},
"ftime": {
"prefix": "ftime",
"body": "${1:FIELDNAME} = forms.TimeField($2, required=${3:False})",
"description": "TimeField (ftime)",
"scope": "source.python"
},
"ftchoice": {
"prefix": "ftchoice",
"body": "${1:FIELDNAME} = forms.TypedChoiceField($2, required=${3:False})",
"description": "TypedChoiceField (ftchoice)",
"scope": "source.python"
},
"ftmuchoice": {
"prefix": "ftmuchoice",
"body": "${1:FIELDNAME} = forms.TypedMultipleChoiceField($2)",
"description": "TypedMultipleChoiceField (ftmuchoice)",
"scope": "source.python"
},
"furl": {
"prefix": "furl",
"body": "${1:FIELDNAME} = forms.URLField($2, required=${3:False})",
"description": "URLField (furl)",
"scope": "source.python"
},
"fuuid": {
"prefix": "fuuid",
"body": "${1:FIELDNAME} = forms.UUIDField($2, required=${3:False})",
"description": "UUIDField (fuuid)",
"scope": "source.python"
},
"fsimplearray": {
"prefix": "fsimplearray",
"body": "${1:FIELDNAME} = SimpleArrayField()",
"description": "SimpleArrayField (fsimplearray).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"fsplitarray": {
"prefix": "fsplitarray",
"body": "${1:FIELDNAME} = SplitArrayField()",
"description": "SplitArrayField (fsplitarray).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"fhstore": {
"prefix": "fhstore",
"body": "${1:FIELDNAME} = HStoreField()",
"description": "HStoreField (fhstore).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"fjson": {
"prefix": "fjson",
"body": "${1:FIELDNAME} = JSONField()",
"description": "JSONField (fjson).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"fintrange": {
"prefix": "fintrange",
"body": "${1:FIELDNAME} = IntegerRangeField()",
"description": "IntegerRangeField (fintrange).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"ffloatrange": {
"prefix": "ffloatrange",
"body": "${1:FIELDNAME} = FloatRangeField()",
"description": "FloatRangeField (ffloatrange).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"fdatetimerange": {
"prefix": "fdatetimerange",
"body": "${1:FIELDNAME} = DateTimeRangeField()",
"description": "DateTimeRangeField (fdatetimerange).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"fdaterange": {
"prefix": "fdaterange",
"body": "${1:FIELDNAME} = DateRangeField()",
"description": "DateRangeField (fdaterange).\n\n*PostgreSQL specific form fields*.",
"scope": "source.python"
},
"ffi": {
"prefix": "ffi",
"body": "from .forms import $1",
"description": "",
"scope": "source.python"
},
"iforms": {
"prefix": "iforms",
"body": "from django import forms",
"description": "from ... import forms",
"scope": "source.python"
},
"ipostgresff": {
"prefix": "ipostgresff",
"body": "from django.contrib.postgres.forms import ${1|SimpleArrayField,SplitArrayField,HStoreField,JSONField,IntegerRangeField,FloatRangeField,DateTimeRangeField,DateRangeField|}",
"description": "PostgreSQL specific forms fields",
"scope": "source.python"
},
"clean_data": {
"prefix": "clean_data",
"body": [
"def clean_${1:FIELD}(self):",
"\t${1:FIELD} = self.cleaned_data.get('${1:FIELD}')",
"\n\n\t # TODO Validation\n",
"\treturn ${1:FIELD}"
],
"description": "",
"scope": "source.python"
}
}

View File

@@ -0,0 +1,377 @@
{
"Model_full": {
"prefix": "Model_full",
"body": [
"class ${1:MODELNAME}(models.Model):",
"\t\"\"\"${2:Model definition for $1}.\"\"\"",
"",
"\t${3:# TODO: Define fields here}",
"",
"\tclass Meta:",
"\t\t\"\"\"Meta definition for $1.\"\"\"",
"",
"\t\tverbose_name = '$1'",
"\t\tverbose_name_plural = '$1s'",
"",
"\tdef ${4|__str__,__unicode__|}(self):",
"\t\t\"\"\"Unicode representation of $1.\"\"\"",
"\t\t${7|pass,return '{}'.format(self. ) # TODO,return f'{self. }' # TODO|}",
"",
"\tdef save(self):",
"\t\t\"\"\"Save method for $1.\"\"\"",
"\t\tpass",
"",
"\tdef get_absolute_url(self):",
"\t\t\"\"\"Return absolute url for $1.\"\"\"",
"\t\treturn ('')",
"",
"\t${6:# TODO: Define custom methods here}",
""
],
"description": "Model (full)",
"scope": "source.python"
},
"Model": {
"prefix": "Model",
"body": [
"class ${1:MODELNAME}(models.Model):",
"\t\"\"\"${2:Model definition for $1}.\"\"\"",
"",
"\t${3:# TODO: Define fields here}",
"",
"\tclass Meta:",
"\t\t\"\"\"Meta definition for $1.\"\"\"",
"",
"\t\tverbose_name = '$1'",
"\t\tverbose_name_plural = '$1s'",
"",
"\tdef ${4|__str__,__unicode__|}(self):",
"\t\t\"\"\"Unicode representation of $1.\"\"\"",
"\t\t${5|pass,return '{}'.format(self. ) # TODO,return f'{self. }' # TODO|}",
""
],
"description": "Model",
"scope": "source.python"
},
"modelmixin": {
"prefix": "modelmixin",
"body": [
"class $1Mixin(models.Model):",
"\t${2:# TODO}\r\n",
"\tclass Meta:",
"\t\tabstract = True"
],
"description": "",
"scope": "source.python"
},
"queryset": {
"prefix": "qs",
"body": ["class $1QuerySet(models.QuerySet):", "\tpass"],
"description": "",
"scope": "source.python"
},
"manager": {
"prefix": "mngr",
"body": [
"class $1Manager(models.Manager):",
"\tdef get_queryset(self):",
"\t\treturn super ($1Manager, self).get_queryset().${2|filter,exclude,order_by,distinct,reverse|}($3)"
],
"description": "Add extra Manager methods",
"scope": "source.python"
},
"queryset_from_manager": {
"prefix": "qs_mngr",
"body": [
"class $1Manager(models.Manager):",
"\tdef get_queryset(self):",
"\t\treturn $1QuerySet(self.model, using=self._db)"
],
"description": "Modify the initial QuerySet the Manager returns.",
"scope": "source.python"
},
"mauto": {
"prefix": "mauto",
"body": "${1:FIELDNAME} = models.AutoField($2)",
"description": "AutoField (mauto).\n\nAn IntegerField that automatically increments according to available IDs.\n\n",
"scope": "source.python"
},
"mbigauto": {
"prefix": "mbigauto",
"body": "${1:FIELDNAME} = models.BigAutoField($2)",
"description": "BigAutoField (mbigauto).\n\n[New in Django 1.10.]\n\nA 64-bit integer, much like an AutoField.\n\n",
"scope": "source.python"
},
"mbigint": {
"prefix": "mbigint",
"body": "${1:FIELDNAME} = models.BigIntegerField($2)",
"description": "BigIntegerField (mbigint).\n\nA 64-bit integer, much like an IntegerField.\n\n",
"scope": "source.python"
},
"mbinary": {
"prefix": "mbinary",
"body": "${1:FIELDNAME} = models.BinaryField($2)",
"description": "BinaryField (mbinary).\n\nA field to store raw binary data.\n\n",
"scope": "source.python"
},
"mbool": {
"prefix": "mbool",
"body": "${1:FIELDNAME} = models.BooleanField($2)",
"description": "BooleanField (mbool).\n\nA true/false field.\n\n",
"scope": "source.python"
},
"mchar": {
"prefix": "mchar",
"body": "${1:FIELDNAME} = models.CharField($2, max_length=${3:50})",
"description": "CharField (mchar)",
"scope": "source.python"
},
"mcoseint": {
"prefix": "mcoseint",
"body": "${1:FIELDNAME} = models.CommaSeparatedIntegerField($2)",
"description": "CommaSeparatedIntegerField (mcoseint).\n\nThis field is deprecated since 1.9 in favor of CharField with validators.\n\n",
"scope": "source.python"
},
"mdate": {
"prefix": "mdate",
"body": "${1:FIELDNAME} = models.DateField($2, auto_now=${3:False}, auto_now_add=${4:False})",
"description": "DateField (mdate).\n\nA date, represented in Python by a datetime.date instance.\n\n",
"scope": "source.python"
},
"mdatetime": {
"prefix": "mdatetime",
"body": "${1:FIELDNAME} = models.DateTimeField($2, auto_now=${3:False}, auto_now_add=${4:False})",
"description": "DateTimeField (mdatetime).\n\nA date, represented in Python by a datetime.datetime instance.\n\n",
"scope": "source.python"
},
"mdecimal": {
"prefix": "mdecimal",
"body": "${1:FIELDNAME} = models.DecimalField($2, max_digits=${3:5}, decimal_places=${4:2})",
"description": "DecimalField (mdecimal).\n\nA fixed-precision decimal number, represented in Python by a Decimal instance.\n\n",
"scope": "source.python"
},
"mduration": {
"prefix": "mduration",
"body": "${1:FIELDNAME} = models.DurationField($2)",
"description": "DurationField (mduration).\n\nA field for storing periods of time - modeled in Python by timedelta.\n\n",
"scope": "source.python"
},
"memail": {
"prefix": "memail",
"body": "${1:FIELDNAME} = models.EmailField($2, max_length=${3:254})",
"description": "EmailField (memail).\n\nA CharField that checks that the value is a valid email address.\n\n",
"scope": "source.python"
},
"mfile": {
"prefix": "mfile",
"body": "${1:FIELDNAME} = models.FileField($2, upload_to=${3:None}, max_length=${4:100})",
"description": "FileField (mfile).\n\nA file-upload field.\n\n",
"scope": "source.python"
},
"mfilepath": {
"prefix": "mfilepath",
"body": "${1:FIELDNAME} = models.FilePathField($2, path=${3:None}, match=${4:None}, recursive=${5:recursive}, max_length=${6:100})",
"description": "FilePathField (mfilepath).\n\nA CharField whose choices are limited to the filenames in a certain directory on the filesystem.\n\n",
"scope": "source.python"
},
"mfloat": {
"prefix": "mfloat",
"body": "${1:FIELDNAME} = models.FloatField($2)",
"description": "FloatField (mfloat).\n\nA floating-point number represented in Python by a float instance.\n\n",
"scope": "source.python"
},
"fk": {
"prefix": "fk",
"body": "${1:FIELDNAME} = models.ForeignKey(${2:OTHERMODEL}, on_delete=models.${3|CASCADE,PROTECT,SET_NULL,SET_DEFAULT,SET(),DO_NOTHING|})",
"description": "ForeignKey (fk).\n\nA many-to-one relationship.\n\non_delete will become a required argument in Django 2.0. In older versions it defaults to CASCADE.\n\n",
"scope": "source.python"
},
"mip": {
"prefix": "mip",
"body": "${1:FIELDNAME} = models.IPAddressField($2)",
"description": "IPAddressField (mip).\n\nThis field has been deprecated since version 1.7 in favor of GenericIPAddressField.\n\n",
"scope": "source.python"
},
"mimg": {
"prefix": "mimg",
"body": "${1:FIELDNAME} = models.ImageField($2, upload_to=${3:None}, height_field=${4:None}, width_field=${5:None}, max_length=${5:100})",
"description": "ImageField (mimg).\n\nInherits all attributes and methods from FileField, but also validates that the uploaded object is a valid image.\n\n",
"scope": "source.python"
},
"mint": {
"prefix": "mint",
"body": "${1:FIELDNAME} = models.IntegerField($2)",
"description": "IntegerField (mint).\n\nAn integer. Values from -2147483648 to 2147483647 are safe in all databases supported by Django.\n\n",
"scope": "source.python"
},
"mgenericip": {
"prefix": "mgenericip",
"body": "${1:FIELDNAME} = models.GenericIPAddressField($2, protocol=${3:'both'}, unpack_ipv4=${4:False})",
"description": "GenericIPAddressField (mimg).\n\nAn IPv4 or IPv6 address, in string format.\n\n",
"scope": "source.python"
},
"m2m": {
"prefix": "m2m",
"body": "${1:FIELDNAME} = models.ManyToManyField(${2:OTHERMODEL})",
"description": "ManyToManyField (m2m).\n\nA many-to-many relationship.\n\n",
"scope": "source.python"
},
"mnullbool": {
"prefix": "mnullbool",
"body": "${1:FIELDNAME} = models.NullBooleanField($2)",
"description": "NullBooleanField (mnullbool).\n\nLike a BooleanField, but allows NULL as one of the options.\n\n",
"scope": "source.python"
},
"o2o": {
"prefix": "o2o",
"body": "${1:FIELDNAME} = models.OneToOneField(${2:OTHERMODEL}, on_delete=models.${3|CASCADE,PROTECT,SET_NULL,SET_DEFAULT,SET(),DO_NOTHING|})",
"description": "OneToOneField (o2o).\n\nA one-to-one relationship.\n\non_delete will become a required argument in Django 2.0. In older versions it defaults to CASCADE.\n\n",
"scope": "source.python"
},
"mphone": {
"prefix": "mphone",
"body": "${1:FIELDNAME} = models.PhoneNumberField($2)",
"description": "PhoneNumberField (mphone).\n\n*external package: django-phonenumber-field*\n\n",
"scope": "source.python"
},
"mposint": {
"prefix": "mposint",
"body": "${1:FIELDNAME} = models.PositiveIntegerField($2)",
"description": "PositiveIntegerField (mposint).\n\nLike an IntegerField, but must be either positive or zero (0).\n\n",
"scope": "source.python"
},
"mpossmallint": {
"prefix": "mpossmallint",
"body": "${1:FIELDNAME} = models.PositiveSmallIntegerField($2)",
"description": "PositiveSmallIntegerField (mpossmallint).\n\nLike a PositiveIntegerField, but only allows values under a certain (database-dependent) point.\n\n",
"scope": "source.python"
},
"mslug": {
"prefix": "mslug",
"body": "${1:FIELDNAME} = models.SlugField($2)",
"description": "SlugField (mslug).\n\nA slug is a short label for something, containing only letters, numbers, underscores or hyphens. Theyre generally used in URLs.\n\n",
"scope": "source.python"
},
"msmallint": {
"prefix": "msmallint",
"body": "${1:FIELDNAME} = models.SmallIntegerField($2)",
"description": "SmallIntegerField (msmallint).\n\nLike an IntegerField, but only allows values under a certain (database-dependent) point.\n\n",
"scope": "source.python"
},
"mtext": {
"prefix": "mtext",
"body": "${1:FIELDNAME} = models.TextField($2)",
"description": "TextField (mtext).\n\nA large text field.\n\n",
"scope": "source.python"
},
"mtime": {
"prefix": "mtime",
"body": "${1:FIELDNAME} = models.TimeField($2, auto_now=${4:False}, auto_now_add=${5:False})",
"description": "TimeField (mtime).\n\nA time, represented in Python by a datetime.time instance.\n\n",
"scope": "source.python"
},
"murl": {
"prefix": "murl",
"body": "${1:FIELDNAME} = models.URLField($2, max_length=${3:200})",
"description": "URLField (murl).\n\nA CharField for a URL.\n\n",
"scope": "source.python"
},
"musstate": {
"prefix": "musstate",
"body": "${1:FIELDNAME} = models.USStateField($2)",
"description": "USStateField (musstate).\n\n*external package: django-localflavor*\n\n",
"scope": "source.python"
},
"muuid": {
"prefix": "muuid",
"body": "${1:FIELDNAME} = models.UUIDField($2)",
"description": "UUIDField (muuid).\n\nA field for storing universally unique identifiers. Uses Pythons UUID class.\n\n",
"scope": "source.python"
},
"mxml": {
"prefix": "mxml",
"body": "${1:FIELDNAME} = models.XMLField($2)",
"description": "XMLField (mxml).\n\n*All uses of XMLField can be replaced with TextField. This field has been deprecated since version 1.3*\n\n",
"scope": "source.python"
},
"mstore": {
"prefix": "mstore",
"body": "${1:FIELDNAME} = HStoreField()",
"description": "HStoreField (mstore).\n\n*PostgreSQL specific model fields*.\n\nA field for storing key-value pairs. The Python data type used is a dict.\n\n",
"scope": "source.python"
},
"mjson": {
"prefix": "mjson",
"body": "${1:FIELDNAME} = JSONField()",
"description": "JSONField (mjson).\n\n*PostgreSQL specific model fields*.\n\n[New in Django 1.11.]\n\nA field for storing JSON encoded data.\n\n",
"scope": "source.python"
},
"marray": {
"prefix": "marray",
"body": "${1:FIELDNAME} = ArrayField()",
"description": "ArrayField (marray).\n\n*PostgreSQL specific model fields*.\n\nA field for storing lists of data\n\n",
"scope": "source.python"
},
"fmai": {
"prefix": "fmai",
"body": "from .managers import $1QuerySet",
"description": "",
"scope": "source.python"
},
"fmi": {
"prefix": "fmi",
"body": "from .models import $1",
"description": "",
"scope": "source.python"
},
"imodels": {
"prefix": "imodels",
"body": "from django.db import models",
"description": "from ... import models",
"scope": "source.python"
},
"ipy2_unicode_compatible": {
"prefix": "iuc",
"body": "from django.utils.encoding import python_2_unicode_compatible",
"description": "For forwards compatibility, this decorator is available as of Django 1.4.2.",
"scope": "source.python"
},
"ipostgresmf": {
"prefix": "ipostgresmf",
"body": "from django.contrib.postgres.fields import ${1|ArrayField,JSONField,HStoreField|}",
"description": "PostgreSQL specific model fields",
"scope": "source.python"
},
"isignals": {
"prefix": "isignals",
"body": "from django.db.models.signals import ${1|pre_init,post_init,pre_save,post_save,pre_delete,post_delete,m2m_changed,class_prepared,Management signals,pre_migrate,post_migrate|}",
"description": "Signals for Django Model",
"scope": "source.python"
},
"__str__": {
"prefix": "str",
"body": ["def __str__(self):", "\treturn self${1: # TODO}"],
"description": "",
"scope": "source.python"
},
"get_absolute_url": {
"prefix": "get_absolute_url",
"body": [
"def get_absolute_url(self):",
"\tfrom django.core.urlresolvers import reverse",
"\treturn reverse('$1', kwargs={'pk': self.pk})"
],
"description": "",
"scope": "source.python"
},
"receiver": {
"prefix": "receiver",
"body": [
"def ${1:FUNCTIONNAME}_${2|pre_init,post_init,pre_save,post_save,pre_delete,post_delete,m2m_changed,class_prepared,Management signals,pre_migrate,post_migrate|}_receiver(sender, instance, *args, **kwargs):",
"\tpass",
"\n\n${2|pre_init,post_init,pre_save,post_save,pre_delete,post_delete,m2m_changed,class_prepared,Management signals,pre_migrate,post_migrate|}.connect(${1:name}_${2|pre_init,post_init,pre_save,post_save,pre_delete,post_delete,m2m_changed,class_prepared,Management signals,pre_migrate,post_migrate|}_receiver, sender=${3:MODELNAME})"
],
"description": "",
"scope": "source.python"
}
}

View File

@@ -0,0 +1,69 @@
{
"ilib": {
"prefix": "ilib",
"body": ["from django import template", "register = template.Library()"],
"description": "",
"scope": "source.python"
},
"li18n": {
"prefix": "li18n",
"body": "{% load i18n %}",
"description": "",
"scope": "text.html.django"
},
"lstatic": {
"prefix": "lstatic",
"body": "{% load staticfiles %}",
"description": "",
"scope": "text.html.django"
},
"ltags": {
"prefix": "ltags",
"body": "{% load $SELECTION$1_tags %}",
"description": "",
"scope": "text.html.django"
},
"register_assignment_tag": {
"prefix": "register_assignment_tag",
"body": [
"def get_$1(context):",
"\trequest = context.get('request')",
"\t$1 = ${2:[]}",
"\treturn ${3:$1}"
],
"description": "",
"scope": "source.python"
},
"register_filter": {
"prefix": "register_filter",
"body": ["@register.filter", "def $1(value):", "\treturn value$2"],
"description": "",
"scope": "source.python"
},
"register_inclusion_tag": {
"prefix": "register_inclusion_tag",
"body": [
"@register.inclusion_tag(${2:'$1.html'}, takes_context=True)",
"def $1(context):",
"\trequest = context.get('request')",
"\t$3",
"\treturn {",
"\t\t'request': request,",
"\t\t$4",
"\t}"
],
"description": "",
"scope": "source.python"
},
"register_simple_tag": {
"prefix": "register_simple_tag",
"body": [
"@register.simple_tag(takes_context=True)",
"def $1(context):",
"\trequest = context.get('request')",
"\treturn ${2:'It Works!'}"
],
"description": "",
"scope": "source.python"
}
}

View File

@@ -0,0 +1,94 @@
{
"urlresolvers": {
"prefix": "iurlresolvers",
"body": "from django.core.urlresolvers import ${1|reverse,reverse_lazy,resolve,get_script_prefix|}",
"description": "*Deprecated since version 1.10*\n\nUtility functions.\n\n",
"scope": "source.python"
},
"urls (≥1.10 & ≤1.11)": {
"prefix": "iurls",
"body": "from django.urls import ${1|reverse,reverse_lazy,resolve,get_script_prefix|}",
"description": "Utility functions for use in URLconfs.",
"scope": "source.python"
},
"conf.urls (≤1.11)": {
"prefix": "iconf_urls",
"body": "from django.conf.urls import ${1|static,url,include,handler400,handler403,handler404,handler500|}",
"description": "Utility functions for use in URLconfs.",
"scope": "source.python"
},
"urls (≥2.0)": {
"prefix": "iurls",
"body": "from django.urls import ${1|path,re_path,include,reverse,reverse_lazy,register_converter|}",
"description": "Utility functions for use in URLconfs.",
"scope": "source.python"
},
"conf.urls (≥2.0)": {
"prefix": "iconf_urls",
"body": "from django.conf.urls import ${1|static,url,handler400,handler403,handler404,handler500|}",
"description": "Utilityfunctions for use in URLconfs.",
"scope": "source.python"
},
"url_stack": {
"prefix": "url_stack",
"body": [
"${1|url,re_path|}(",
"\tr'^${2:REGEX}/$',",
"\t${3:VIEW}${4:.as_view()},",
"\tname='$5'",
"),"
],
"description": "url(regex, view, kwargs=None, name=None)\n\n*url is an alias to re_path*\n\n",
"scope": "source.python"
},
"url_inline": {
"prefix": "url_inline",
"body": [
"${1|url,re_path|}(r'^${2:REGEX}/$', ${3:VIEW}${4:.as_view()}, name='$5'),"
],
"description": "url(regex, view, kwargs=None, name=None)\n\n*url is an alias to re_path*\n\n",
"scope": "source.python"
},
"path_stack": {
"prefix": "path_stack",
"body": [
"path(",
"\t'${1:ROUTE}/',",
"\t${2:VIEW}${3:.as_view()},",
"\tname='$4'",
"),"
],
"description": "path(route, view, kwargs=None, name=None)",
"scope": "source.python"
},
"path_inline": {
"prefix": "path_inline",
"body": ["path('${1:ROUTE}/', ${2:VIEW}${3:.as_view()}, name='$4'),"],
"description": "path(route, view, kwargs=None, name=None)",
"scope": "source.python"
},
"urlpatterns": {
"prefix": "urlpatterns",
"body": ["urlpatterns = [", "\t$0", "]"],
"description": "",
"scope": "source.python"
},
"repk": {
"prefix": "repk",
"body": "r'^(?P<${1:pk}>d+)/$'",
"description": "PK URL regex",
"scope": "source.python"
},
"reslug": {
"prefix": "reslug",
"body": "r'^(?P<${1:slug}>[-w]+)/$'",
"description": "Slug URL regex",
"scope": "source.python"
},
"reusername": {
"prefix": "reusername",
"body": "r'^(?P<username>[w.@+-]+)/$'",
"description": "Username regex",
"scope": "source.python"
}
}

View File

@@ -0,0 +1,85 @@
{
"createview": {
"prefix": "createview",
"body": "\r\nclass ${1:MODEL_NAME}CreateView(CreateView):\r\n model = ${1:MODEL_NAME}\r\n template_name = \"${2:TEMPLATE_NAME}\"\r\n",
"description": "",
"scope": "source.python"
},
"deleteview": {
"prefix": "deleteview",
"body": "\r\nclass ${1:MODEL_NAME}DeleteView(DeleteView):\r\n model = ${1:MODEL_NAME}\r\n template_name = \"${2:TEMPLATE_NAME}\"\r\n",
"description": "",
"scope": "source.python"
},
"detailview": {
"prefix": "detailview",
"body": "\r\nclass ${1:MODEL_NAME}DetailView(DetailView):\r\n model = ${1:MODEL_NAME}\r\n template_name = \"${2:TEMPLATE_NAME}\"\r\n",
"description": "",
"scope": "source.python"
},
"listview": {
"prefix": "listview",
"body": "\r\nclass ${1:MODEL_NAME}ListView(ListView):\r\n model = ${1:MODEL_NAME}\r\n template_name = \"${2:TEMPLATE_NAME}\"\r\n",
"description": "",
"scope": "source.python"
},
"templateview": {
"prefix": "templateview",
"body": "\r\nclass ${1:CLASS_NAME}(TemplateView):\r\n template_name = \"${2:TEMPLATE_NAME}\"\r\n",
"description": "",
"scope": "source.python"
},
"updateview": {
"prefix": "updateview",
"body": "\r\nclass ${1:MODEL_NAME}UpdateView(UpdateView):\r\n model = ${1:MODEL_NAME}\r\n template_name = \"${2:TEMPLATE_NAME}\"\r\n",
"description": "",
"scope": "source.python"
},
"from views import": {
"prefix": "fvi",
"body": "from .views import $1",
"description": "",
"scope": "source.python"
},
"igenericviews": {
"prefix": "igenericviews",
"body": "from django.views.generic import ${1|CreateView,DetailView,FormView,ListView,TemplateView,UpdateView|}",
"description": "Generic class-based views",
"scope": "source.python"
},
"isettings": {
"prefix": "isettings",
"body": "from django.conf import settings",
"description": "from django.conf import settings",
"scope": "source.python"
},
"view": {
"prefix": "view",
"body": "def ${1:VIEWNAME}(request):",
"description": "View",
"scope": "source.python"
},
"dispatch": {
"prefix": "dispatch",
"body": "\r\ndef dispatch(self, request, *args, **kwargs):\r\n return super(${1:CLASS_NAME}, self).dispatch(request, *args, **kwargs)\r\n",
"description": "",
"scope": "source.python"
},
"context": {
"prefix": "get_context_data",
"body": "\r\ndef get_context_data(self, **kwargs):\r\n context = super(${1:CLASS_NAME}, self).get_context_data(**kwargs)\r\n return context\r\n",
"description": "",
"scope": "source.python"
},
"get_queryset": {
"prefix": "get_queryset",
"body": [
"def get_queryset(self):",
"\tqueryset = super(${1:CLASS_NAME}, self).get_queryset()",
"\tqueryset = queryset${3: # TODO}",
"\treturn queryset"
],
"description": "",
"scope": "source.python"
}
}

View File

@@ -0,0 +1,335 @@
{
"autoescape": {
"prefix": "autoescape",
"description": "autoescape tag django template",
"body": [
"{% autoescape ${off} %}",
"$2",
"{% autoescape %}"
]
},
"block": {
"prefix": "block",
"description": "block tag django template",
"body": [
"{% block ${blockname} %}",
"$2",
"{% endblock ${blockname} %}"
]
},
"comment": {
"prefix": "comment",
"description": "Comment tag django template",
"body": [
"{% comment %}",
" $1",
"{% endcomment %}"
]
},
"csrf": {
"prefix": "csrf",
"description": "csrf token django template",
"body": [
"{% csrf_token %}"
]
},
"cycle": {
"prefix": "cycle",
"description": "cycle tag django template",
"body": [
"{% cycle %}"
]
},
"debug": {
"prefix": "debug",
"description": "debug tag django template",
"body": [
"{% debug %}"
]
},
"ext": {
"prefix": "ext",
"description": "extends tag django template",
"body": [
"{% extends \"$1\" %}"
]
},
"extends": {
"prefix": "extends",
"description": "extends tag django template",
"body": [
"{% extends \"$1\" %}"
]
},
"filter": {
"prefix": "filter",
"description": "filter tag django template",
"body": [
"{% filter $1 %}",
"$2",
"{% endfilter %}"
]
},
"firstof": {
"prefix": "firstof",
"description": "firstof tag django template",
"body": [
"{% firstof %}"
]
},
"for": {
"prefix": "for",
"description": "for tag django template",
"body": [
"{% for $1 in $2 %}",
"$3",
"{% endfor %}"
]
},
"fore": {
"prefix": "fore",
"description": "foreach with empty tag django template",
"body": [
"{% for $1 in $2 %}",
"$3",
"{% empty %}",
"$4",
"{% endfor %}"
]
},
"if": {
"prefix": "if",
"description": "if tag django template",
"body": [
"{% if $1 %}",
"$2",
"{% endif %}"
]
},
"ifchanged": {
"prefix": "ifchanged",
"description": "ifchanged tag django template",
"body": [
"{% ifchanged $1 %}",
"$2",
"{% endifchanged %}"
]
},
"ife": {
"prefix": "ife",
"description": "if else tag django template",
"body": [
"{% if $1 %}",
"$2",
"{% else %}",
"$3",
"{% endif %}",
""
]
},
"ifelse": {
"prefix": "ifelse",
"description": "if else tag django template",
"body": [
"{% if $1 %}",
"$2",
"{% else %}",
"$3",
"{% endif %}",
""
]
},
"ifeq": {
"prefix": "ifeq",
"description": "ifequal tag django template",
"body": [
"{% ifequal $1 %}",
"$2",
"{% endifequal %}"
]
},
"ifequal": {
"prefix": "ifeq",
"description": "ifequal tag django template",
"body": [
"{% ifequal $1 %}",
"$2",
"{% endifequal %}"
]
},
"ifnotequal": {
"prefix": "ifnotequal",
"description": "ifnotequal tag django template",
"body": [
"{% ifnotequal $1 %}",
"$2",
"{% ifnotequal %}"
]
},
"inc": {
"prefix": "inc",
"description": "include tag django template",
"body": [
"{% include \"$1\" %}"
]
},
"include": {
"prefix": "include",
"description": "include tag django template",
"body": [
"{% include \"$1\" %}"
]
},
"load": {
"prefix": "load",
"description": "load tag django template",
"body": [
"{% load $1 %}"
]
},
"now": {
"prefix": "now",
"description": "now tag django template",
"body": [
"{% now \"$1\" %}"
]
},
"regroup": {
"prefix": "regroup",
"description": "regroup tag django template",
"body": [
"{% regroup $1 by $2 as $3 %}"
]
},
"spaceless": {
"prefix": "spaceless",
"description": "spaceless tag django template",
"body": [
"{% spaceless %}",
" $1",
"{% endspaceless %}"
]
},
"ssi": {
"prefix": "ssi",
"description": "ssi tag django template",
"body": [
"{% ssi $1 parsed %}"
]
},
"static": {
"prefix": "static",
"description": "static tag django template",
"body": [
"{% static \"$1\" %}"
]
},
"templatetag": {
"prefix": "templatetag",
"description": "templatetag tag django template",
"body": [
"{% templatetag $1 %}"
]
},
"url": {
"prefix": "url",
"description": "url tag django template",
"body": [
"{% url $1 %}"
]
},
"verbatim": {
"prefix": "verbatim",
"description": "verbatim tag django template",
"body": [
"{% verbatim %}",
" $1",
"{% endverbatim %}"
]
},
"widthratio": {
"prefix": "widthratio",
"description": "widthratio tag django template",
"body": [
"{% widthratio ${this_value} max_value 100 %}"
]
},
"with": {
"prefix": "with",
"description": "with tag django template",
"body": [
"{% with $1 as $2 %}",
"$3",
"{% endwith %}"
]
},
"trans": {
"prefix": "trans",
"description": "trans tag django template",
"body": [
"{% trans \"$1\" %}"
]
},
"blocktrans": {
"prefix": "blocktrans",
"description": "blocktrans tag django template",
"body": [
"{% blocktrans %}",
" $1",
"{% endblocktrans %}"
]
},
"super": {
"prefix": "super",
"description": "Block super",
"body": [
"{{ block.super }}"
]
},
"extrahead": {
"prefix": "extrahead",
"description": "Extrahead no oficial tag",
"body": [
"{% block extrahead %}",
" $1",
"{% endblock extrahead %}"
]
},
"extrastyle": {
"prefix": "extrastyle",
"description": "Extrastyle no oficial Tag",
"body": [
"{% block extrahead %}",
" $1",
"{% endblock extrahead %}"
]
},
"var": {
"prefix": "var",
"description": "Variable autocomplete",
"body": [
"{{ $1 }}"
]
},
"tag": {
"prefix": "tag",
"description": "tag autocomplete no oficial",
"body": [
"{% $1 %}"
]
},
"staticurl": {
"prefix": "staticurl",
"description": "STATIC_URL no oficial var",
"body": [
"{{ STATIC_URL }}"
]
},
"mediaurl": {
"prefix": "mediaurl",
"description": "",
"body": [
"{{ MEDIA_URL }}"
]
}
}

View File

@@ -0,0 +1,322 @@
{
"edge: Block": {
"prefix": "block",
"body": ["{{ $1 }}"],
"description": "Edge: block tag"
},
"edge: Comment": {
"prefix": "comment",
"body": ["{{-- $1 --}}"],
"description": "Edge: comment tag"
},
"edge: Conditional": {
"prefix": "@if",
"body": ["@if($1)", " $2", "@end"],
"description": "Edge: if tag accepts the expression to evaluate as the only argument."
},
"edge: Conditional with an else statement": {
"prefix": "@ifelse",
"body": ["@if($1)", " $2", "@else", " $3", "@end"],
"description": "Edge: if else tag accepts the expression to evaluate as the only argument."
},
"edge: Conditional with else and elseif statement": {
"prefix": "@ifelseif",
"body": ["@if($1)", " $2", "@elseif($3)", " $4", "@else", " $5", "@end"],
"description": "Edge: if else tag"
},
"edge: Inverse conditional": {
"prefix": "@unless",
"body": ["@unless($1)", " $2", "@else", " $3", "@end"],
"description": "Edge: unless tag inverse if statement."
},
"edge: for each loop with index": {
"prefix": "@each-index",
"body": ["@each(${1:key}, ${2:value} in ${3:object})", " $3", "@end"],
"description": "Edge: each index tag with key value"
},
"edge: For Each Loop": {
"prefix": "@each-in",
"body": ["@each(${1:item} in ${2:array})", " $3", "@end"],
"description": "Edge: each in tag let you loop over an array or an object of values."
},
"edge: Component with body": {
"prefix": "@component",
"body": ["@component('${1:name}')", " $2", "@end"],
"description": "Edge: component tag allows you to use an Edge template as a component."
},
"edge: Inline component": {
"prefix": "@!component",
"body": ["@!component('${1:name}')"],
"description": "Edge: inline component tag allows you to use an Edge template as a component."
},
"edge: Component slot": {
"prefix": "@slot",
"body": ["@slot('${1:name}')", " $2", "@end"],
"description": "Edge: slot tag allows you define the markup for the named slots. It accepts the slot name as the first argument and can also receive additional arguments from the component template."
},
"edge: Inject": {
"prefix": "@inject",
"body": ["@inject('${1:values}')"],
"description": "Edge: inject tag allows the component template to inject data into the component tree. The tag accepts an object as the only argument."
},
"edge: Include partial": {
"prefix": "@include",
"body": ["@include('${1:name}')"],
"description": "Edge: include tag allows you include a partial to a given template"
},
"edge: Include conditional partial": {
"prefix": "@includeIf",
"body": ["@includeIf(${1:condition}, '${2:name}')"],
"description": "Edge: includeif tag to include a partial conditionally. The first argument is the condition to evaluate before including the partial."
},
"edge: Layout": {
"prefix": "@layout",
"body": ["@layout('${1:name}')"],
"description": "Edge: layout tag allows you define the layout template for the current template."
},
"edge: Section block": {
"prefix": "@section",
"body": ["@section('${1:name}')", " $2", "@end"],
"description": "Edge: section tag use the layout must define all the markup inside the sections exported by the layout"
},
"edge: Inline section": {
"prefix": "@!section",
"body": ["@!section('${1:name}')"],
"description": "Edge: section inline tag use the layout must define all the markup inside the sections exported by the layout"
},
"edge: Super": {
"prefix": "@super",
"body": ["@super"],
"description": "Edge: super tag allows you to inherit the existing content of the section. It is an inline tag and does not accept any arguments."
},
"edge: Bouncer can guard": {
"prefix": "@can",
"body": ["@can('${1:ability}', ${2:args})", " $3", "@end"],
"description": "Edge: can tag from @adonisjs/bouncer allows you write conditionals around the bouncer permissions."
},
"edge: Bouncer cannot guard": {
"prefix": "@cannot",
"body": ["@cannot('${1:ability}', ${2:args})", " $3", "@end"],
"description": "Edge: cannot tag from @adonisjs/bouncer allows you write conditionals around the bouncer permissions."
},
"edge: Debugger": {
"prefix": "@debugger",
"body": ["@debugger"],
"description": "Edge: debugger tag is an inline tag. It drops the debugger keyword to the template output. You can use the chrome devtools to debug the compiled templates."
},
"edge: Define local variable": {
"prefix": "@set",
"body": ["@set('$1', $2)"],
"description": "Edge: set tag is an inline tag. That allows you to define local variables within the template scope or mutate the value of an existing variable."
},
"edge: Entry point scripts": {
"prefix": "@entryPointScripts",
"body": ["@entryPointScripts('$1')"],
"description": "Edge: entryPointScripts tag is an inline tag. Renders the required script for a given entrypoint."
},
"edge: Entry point styles": {
"prefix": "@entryPointStyles",
"body": ["@entryPointStyles('$1')"],
"description": "Edge: entryPointStyles tag is an inline tag. Renders the required link for a given entrypoint."
},
"edge: app": {
"prefix": "app",
"body": "app",
"description": "Reference to application instance"
},
"edge: asset": {
"prefix": "asset",
"body": "asset('${1:filePath}')",
"description": "Get path to a frontend asset"
},
"edge: auth.isLoggedIn": {
"prefix": "auth.isLoggedIn",
"body": "auth.isLoggedIn",
"description": "Find if user is loggedin"
},
"edge: auth.user": {
"prefix": "auth.user",
"body": "auth.user",
"description": "Get auth user"
},
"edge: camelCase": {
"prefix": "camelCase",
"body": "camelCase(${1:'${2:value}'})",
"description": "Convert a string to camelcase"
},
"edge: capitalCase": {
"prefix": "capitalCase",
"body": "capitalCase(${1:'${2:value}'})",
"description": "Convert a string to capitalCase"
},
"edge: config": {
"prefix": "config",
"body": "config('${1:key}')",
"description": "Get config value"
},
"edge: cspNonce": {
"prefix": "cspNonce",
"body": "cspNonce",
"description": "Use csp nonce on script tag"
},
"edge: csrfField": {
"prefix": "csrfField()",
"body": "csrfField()",
"description": "Add csrfField input field to form"
},
"edge: dashCase": {
"prefix": "dashCase",
"body": "dashCase(${1:'${2:value}'})",
"description": "Convert a string to dashCase"
},
"edge: dotCase": {
"prefix": "dotCase",
"body": "dotCase(${1:'${2:value}'})",
"description": "Convert a string to dotCase"
},
"edge: driveSignedUrl": {
"prefix": "driveSignedUrl",
"body": "await driveSignedUrl('${1:location}'${2:, 'optionalDiskName'})",
"description": "Get signed URL to a file using AdonisJS drive"
},
"edge: driveUrl": {
"prefix": "driveUrl",
"body": "await driveUrl('${1:location}'${2:, 'optionalDiskName'})",
"description": "Get URL to a file using AdonisJS drive"
},
"edge: e": {
"prefix": "e",
"body": "e(${1:'${2:markup}'})",
"description": "Escape HTML markup"
},
"edge: env": {
"prefix": "env",
"body": "env('${1:key}')",
"description": "Get environment variable value"
},
"edge: excerpt": {
"prefix": "excerpt",
"body": "excerpt(${1:value}, ${2:100})",
"description": "Generate plain text excerpt and truncate after given characters count"
},
"edge: flashMessages.all": {
"prefix": "inspect(flashMessages.all())",
"body": "inspect(flashMessages.all())",
"description": "Inspect all messages"
},
"edge: flashMessages.get": {
"prefix": "flashMessages.get",
"body": "flashMessages.get('$1', $2)",
"description": "Get flash message value"
},
"edge: flashMessages.has": {
"prefix": "flashMessages.has",
"body": "flashMessages.has('$1')",
"description": "Check if a flash message exists"
},
"edge: inspect": {
"body": "inspect($1)",
"prefix": "inspect",
"description": "inspect global helper to inspect a value or the entire state of the template. The helper method can pretty print the following JavaScript primitives."
},
"edge: nl2br": {
"prefix": "nl2br",
"body": "nl2br(e(${1:'${2:body}'}))",
"description": "Convert new line to br tags"
},
"edge: noCase": {
"prefix": "noCase",
"body": "noCase(${1:'${2:value}'})",
"description": "Remove all sort of casing from a string"
},
"edge: ordinalize": {
"prefix": "ordinalize",
"body": "ordinalize(${1:value})",
"description": "Ordinalize a string or a number value"
},
"edge: pascalCase": {
"prefix": "pascalCase",
"body": "pascalCase(${1:'${2:value}'})",
"description": "Convert a string to pascalCase"
},
"edge: pluralize": {
"prefix": "pluralize",
"body": "pluralize(${1:value}${2:, optionalCount})",
"description": "Pluralize a word"
},
"edge: prettyBytes": {
"prefix": "prettyBytes",
"body": "prettyBytes(${1:1024})",
"description": "Pretty print bytes to human readable string"
},
"edge: prettyMs": {
"prefix": "prettyMs",
"body": "prettyMs(${1:60000})",
"description": "Pretty print milliseconds to human readable string"
},
"edge: props.serialize": {
"prefix": "psl",
"body": "\\$props.serialize(${1:optionalObjectToMerge})",
"description": "Serialize component props to HTML attributes"
},
"edge: props.serializeExcept": {
"prefix": "psle",
"body": "\\$props.serializeExcept([$1], ${2:optionalObjectToMerge})",
"description": "Serialize selected component props to HTML attributes"
},
"edge: props.serializeOnly": {
"prefix": "pslo",
"body": "\\$props.serializeOnly([$1], ${2:optionalObjectToMerge})",
"description": "Serialize selected component props to HTML attributes"
},
"edge: route": {
"prefix": "route",
"body": "route('${1:routeName}', ${2:[args]})",
"description": "Make URL for a route"
},
"edge: safe": {
"prefix": "safe",
"body": "safe(${1:'${2: markup}'})",
"description": "Render HTML markup without escaping it"
},
"edge: sentenceCase": {
"prefix": "sentenceCase",
"body": "sentenceCase(${1:'${2:value}'})",
"description": "Convert a string to sentenceCase"
},
"edge: signedRoute": {
"prefix": "signedRoute",
"body": "signedRoute('${1:routeName}', ${2:[args]})",
"description": "Make signed URL for a route"
},
"edge: snakeCase": {
"prefix": "snakeCase",
"body": "snakeCase(${1:'${2:value}'})",
"description": "Convert a string to snakeCase"
},
"edge: titleCase": {
"prefix": "titleCase",
"body": "titleCase(${1:'${2:value}'})",
"description": "Convert a string to titleCase"
},
"edge: toBytes": {
"prefix": "toBytes",
"body": "toBytes(${1:'1MB'})",
"description": "Convert human readable expression to bytes"
},
"edge: toMs": {
"prefix": "toMs",
"body": "toMs(${1:'1min'})",
"description": "Convert human readable expression to milliseconds"
},
"edge: toSentence": {
"prefix": "toSentence",
"body": "toSentence([${1:'car'}, ${2: 'truck'}, ${3: 'van'}], { separator: ', ', lastSeparator: ', or ' })",
"description": "Convert an array to a sentence"
},
"edge: truncate": {
"prefix": "truncate",
"body": "truncate(${1:value}, ${2:100})",
"description": "Truncate string after given characters count"
}
}

View File

@@ -0,0 +1,87 @@
{
"EJS No Output": {
"prefix": "ejs",
"body": [
"<% $1 %> $2"
],
"description": "EJS No Output"
},
"EJS Output Value": {
"prefix": "ejsout",
"body": [
"<%= $1 %> $2"
],
"description": "EJS outputs no value"
},
"EJS Output Escaped": {
"prefix": "ejsesc",
"body": [
"<%- $1 %> $2"
],
"description": "EJS outputs value"
},
"EJS Comment": {
"prefix": "ejscom",
"body": [
"<%# $1 %> $2"
],
"description": "EJS comment tag with no output"
},
"EJS Literal": {
"prefix": "ejslit",
"body": [
"<%% $1 %> $2"
],
"description": "EJS outputs a literal '<%'"
},
"EJS Include": {
"prefix": "ejsinc",
"body": [
"<% include $1 %> $2"
],
"description": "EJS include statement"
},
"EJS For Loop": {
"prefix": "ejsfor",
"body": [
"<% for( let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++ ) { %>",
"$3",
"<% } %>"
],
"description": "EJS For Loop"
},
"EJS ForEach": {
"prefix": "ejseach",
"body": [
"<% ${1:array}.forEach(${2:element} => { %>",
" $3",
"<% }) %>"
],
"description": "EJS ForEach Loop"
},
"EJS If Statement": {
"prefix": "ejsif",
"body": [
"<% if (${1:condition}) { %>",
" $2",
"<% } %>"
],
"description": "EJS if statement"
},
"EJS Else Statement": {
"prefix": "ejselse",
"body": [
"<% } else { %>",
" $1"
],
"description": "EJS if statement"
},
"EJS Else If Statement": {
"prefix": "ejselif",
"body": [
"<% } else if ({$1:condition}) { %>",
" $2"
],
"description": "EJS if statement"
}
}

View File

@@ -0,0 +1,498 @@
{
"Stateless Widget": {
"prefix": "statelessW",
"body": [
"class ${1:name} extends StatelessWidget {",
" const ${1:name}({super.key});\n",
" @override",
" Widget build(BuildContext context) {",
" return Container(",
" child: ${2:null},",
" );",
" }",
"}"
],
"description": "Create a Stateless widget"
},
"Stateful Widget": {
"prefix": "statefulW",
"body": [
"class ${1:name} extends StatefulWidget {",
" ${1:name}({super.key});\n",
" @override",
" State<${1:WidgetName}> createState() => _${1:WidgetName}State();",
"}\n",
"class _${1:index}State extends State<${1:index}> {",
" @override",
" Widget build(BuildContext context) {",
" return Container(",
" child: ${2:null},",
" );",
" }",
"}"
],
"description": "Create a Stateful widget"
},
"Build Method": {
"prefix": "build",
"body": [
"@override",
"Widget build(BuildContext context) {",
" return ${0:};",
"}"
],
"description": "Describes the part of the user interface represented by this widget."
},
"Custom Painter ": {
"prefix": "customPainter",
"body": [
"class ${0:name}Painter extends CustomPainter {",
"",
" @override",
" void paint(Canvas canvas, Size size) {",
" }",
"",
" @override",
" bool shouldRepaint(${0:name}Painter oldDelegate) => false;",
"",
" @override",
" bool shouldRebuildSemantics(${0:name}Painter oldDelegate) => false;",
"}"
],
"description": "Used for creating custom paint"
},
"Custom Clipper ": {
"prefix": "customClipper",
"body": [
"class ${0:name}Clipper extends CustomClipper<Path> {",
"",
" @override",
" Path getClip(Size size) {",
" }",
"",
" @override",
" bool shouldReclip(CustomClipper<Path> oldClipper) => false;",
"}"
],
"description": "Used for creating custom shapes"
},
"InitState ": {
"prefix": "initS",
"body": [
"@override",
"void initState() { ",
" super.initState();",
" ${0:}",
"}"
],
"description": "Called when this object is inserted into the tree. The framework will call this method exactly once for each State object it creates."
},
"Dispose": {
"prefix": "dis",
"body": [
"@override",
"void dispose() { ",
" ${0:}",
" super.dispose();",
"}"
],
"description": "Called when this object is removed from the tree permanently. The framework calls this method when this State object will never build again."
},
"Reassemble": {
"prefix": "reassemble",
"body": [
"@override",
"void reassemble(){",
" super.reassemble();",
" ${0:}",
"}"
],
"description": "Called whenever the application is reassembled during debugging, for example during hot reload."
},
"didChangeDependencies": {
"prefix": "didChangeD",
"body": [
"@override",
"void didChangeDependencies() {",
" super.didChangeDependencies();",
" ${0:}",
"}"
],
"description": "Called when a dependency of this State object changes"
},
"didUpdateWidget": {
"prefix": "didUpdateW",
"body": [
"@override",
"void didUpdateWidget (${1:Type} ${2:oldWidget}) {",
" super.didUpdateWidget(${2:oldWidget});",
" ${0:}",
"}"
],
"description": "Called whenever the widget configuration changes."
},
"ListView.Builder": {
"prefix": "listViewB",
"body": [
"ListView.builder(",
" itemCount: ${1:1},",
" itemBuilder: (BuildContext context, int index) {",
" return ${2:};",
" },",
"),"
],
"description": "Creates a scrollable, linear array of widgets that are created on demand.Providing a non-null `itemCount` improves the ability of the [ListView] to estimate the maximum scroll extent."
},
"ListView.Separated": {
"prefix": "listViewS",
"body": [
"ListView.separated(",
" itemCount: ${1:1},",
" separatorBuilder: (BuildContext context, int index) {",
" return ${2:};",
" },",
" itemBuilder: (BuildContext context, int index) {",
" return ${3:};",
" },",
"),"
],
"description": "Creates a fixed-length scrollable linear array of list 'items' separated by list item 'separators'."
},
"GridView.Builder": {
"prefix": "gridViewB",
"body": [
"GridView.builder(",
" gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(",
" crossAxisCount: ${1:2},",
" ),",
" itemCount: ${2:2},",
" itemBuilder: (BuildContext context, int index) {",
" return ${3:};",
" },",
"),"
],
"description": "Creates a scrollable, 2D array of widgets that are created on demand. Providing a non-null `itemCount` improves the ability of the [GridView] to estimate the maximum scroll extent."
},
"GridView.Count": {
"prefix": "gridViewC",
"body": [
"GridView.count(",
" crossAxisSpacing: ${1:1},",
" mainAxisSpacing: ${2:2},",
" crossAxisCount: ${3:2},",
" children: <Widget> [",
" ${4:}",
" ],",
"),"
],
"description": "Creates a scrollable, 2D array of widgets with a fixed number of tiles in the cross axis."
},
"GridView.Extent": {
"prefix": "gridViewE",
"body": [
"GridView.extent(",
" maxCrossAxisExtent: ${1:2},",
" children: <Widget> [",
" ${2:}",
" ],",
"),"
],
"description": "Creates a scrollable, 2D array of widgets with tiles that each have a maximum cross-axis extent."
},
"Custom Scroll View": {
"prefix": "customScrollV",
"body": [
"CustomScrollView(",
" slivers: <Widget>[",
" ${0:}",
" ],",
"),"
],
"description": "Creates a `ScrollView` that creates custom scroll effects using slivers. If the `primary` argument is true, the `controller` must be null."
},
"Stream Builder": {
"prefix": "streamBldr",
"body": [
"StreamBuilder(",
" stream: ${1:stream},",
" initialData: ${2:initialData},",
" builder: (BuildContext context, AsyncSnapshot snapshot) {",
" return Container(",
" child: ${3:child},",
" );",
" },",
"),"
],
"description": "Creates a new `StreamBuilder` that builds itself based on the latest snapshot of interaction with the specified `stream`"
},
"Animated Builder": {
"prefix": "animatedBldr",
"body": [
"AnimatedBuilder(",
" animation: ${1:animation},",
" child: ${2:child},",
" builder: (BuildContext context, Widget child) {",
" return ${3:};",
" },",
"),"
],
"description": "Creates an Animated Builder. The widget specified to `child` is passed to the `builder` "
},
"Stateful Builder": {
"prefix": "statefulBldr",
"body": [
"StatefulBuilder(",
" builder: (BuildContext context, setState) {",
" return ${0:};",
" },",
"),"
],
"description": "Creates a widget that both has state and delegates its build to a callback. Useful for rebuilding specific sections of the widget tree."
},
"Orientation Builder": {
"prefix": "orientationBldr",
"body": [
"OrientationBuilder(",
" builder: (BuildContext context, Orientation orientation) {",
" return Container(",
" child: ${3:child},",
" );",
" },",
"),"
],
"description": "Creates a builder which allows for the orientation of the device to be specified and referenced"
},
"Layout Builder": {
"prefix": "layoutBldr",
"body": [
"LayoutBuilder(",
" builder: (BuildContext context, BoxConstraints constraints) {",
" return ${0:};",
" },",
"),"
],
"description": "Similar to the Builder widget except that the framework calls the builder function at layout time and provides the parent widget's constraints."
},
"Single Child ScrollView": {
"prefix": "singleChildSV",
"body": [
"SingleChildScrollView(",
" controller: ${1:controller,}",
" child: Column(",
" ${0:}",
" ),",
"),"
],
"description": "Creates a scroll view with a single child"
},
"Future Builder": {
"prefix": "futureBldr",
"body": [
"FutureBuilder(",
" future: ${1:Future},",
" initialData: ${2:InitialData},",
" builder: (BuildContext context, AsyncSnapshot snapshot) {",
" return ${3:};",
" },",
"),"
],
"description": "Creates a Future Builder. This builds itself based on the latest snapshot of interaction with a Future."
},
"No Such Method": {
"prefix": "nosm",
"body": [
"@override",
"dynamic noSuchMethod(Invocation invocation) {",
" ${1:}",
"}"
],
"description": "This method is invoked when a non-existent method or property is accessed."
},
"Inherited Widget": {
"prefix": "inheritedW",
"body": [
"class ${1:Name} extends InheritedWidget {",
" ${1:Name}({Key? key, required this.child}) : super(key: key, child: child);",
"",
" final Widget child;",
"",
" static ${1:Name}? of(BuildContext context) {",
" return context.dependOnInheritedWidgetOfExactType<${1:Name}>();",
" }",
"",
" @override",
" bool updateShouldNotify(${1:Name} oldWidget) {",
" return ${2:true};",
" }",
"}"
],
"description": "Class used to propagate information down the widget tree"
},
"Mounted": {
"prefix": "mounted",
"body": [
"@override",
"bool get mounted {",
" ${0:}",
"}"
],
"description": "Whether this State object is currently in a tree."
},
"Sink": {
"prefix": "snk",
"body": [
"Sink<${1:type}> get ${2:name} => _${2:name}Controller.sink;",
"final _${2:name}Controller = StreamController<${1:type}>();"
],
"description": "A Sink is the input of a stream."
},
"Stream": {
"prefix": "strm",
"body": [
"Stream<${1:type}> get ${2:name} => _${2:name}Controller.stream;",
"final _${2:name}Controller = StreamController<${1:type}>();"
],
"description": "A source of asynchronous data events. A stream can be of any data type <T>"
},
"Subject": {
"prefix": "subj",
"body": [
"Stream<${1:type}> get ${2:name} => _${2:name}Subject.stream;",
"final _${2:name}Subject = BehaviorSubject<${1:type}>();"
],
"description": "A BehaviorSubject is also a broadcast StreamController which returns an Observable rather than a Stream."
},
"toString": {
"prefix": "toStr",
"body": [
"@override",
"String toString() {",
"return ${1:toString};",
" }"
],
"description": "Returns a string representation of this object."
},
"debugPrint": {
"prefix": "debugP",
"body": [
"debugPrint(${1:statement});"
],
"description": "Prints a message to the console, which you can access using the flutter tool's `logs` command (flutter logs)."
},
"Material Package": {
"prefix": "importM",
"body": "import 'package:flutter/material.dart';",
"description": "Import flutter material package"
},
"Cupertino Package": {
"prefix": "importC",
"body": "import 'package:flutter/cupertino.dart';",
"description": "Import Flutter Cupertino package"
},
"flutter_test Package": {
"prefix": "importFT",
"body": "import 'package:flutter_test/flutter_test.dart';",
"description": "Import flutter_test package"
},
"Material App": {
"prefix": "mateapp",
"description": "Create a MaterialApp",
"body": [
"import 'package:flutter/material.dart';",
" ",
"void main() => runApp(MyApp());",
" ",
"class MyApp extends StatelessWidget {",
" @override",
" Widget build(BuildContext context) {",
" return MaterialApp(",
" title: 'Material App',",
" home: Scaffold(",
" appBar: AppBar(",
" title: Text('Material App Bar'),",
" ),",
" body: Center(",
" child: Container(",
" child: Text('Hello World'),",
" ),",
" ),",
" ),",
" );",
" }",
"}"
]
},
"Cupertino App": {
"prefix": "cupeapp",
"description": "Create a CupertinoApp",
"body": [
"import 'package:flutter/cupertino.dart';",
" ",
"void main() => runApp(MyApp());",
" ",
"class MyApp extends StatelessWidget {",
" @override",
" Widget build(BuildContext context) {",
" return CupertinoApp(",
" title: 'Cupertino App',",
" home: CupertinoPageScaffold(",
" navigationBar: CupertinoNavigationBar(",
" middle: Text('Cupertino App Bar'),",
" ),",
" child: Center(",
" child: Container(",
" child: Text('Hello World'),",
" ),",
" ),",
" ),",
" );",
" }",
"}"
]
},
"Tween Animation Builder": {
"prefix": "tweenAnimationBuilder",
"body": [
"TweenAnimationBuilder(",
" duration: ${1:const Duration(),}",
" tween: ${2:Tween(),}",
" builder: (BuildContext context, ${3:dynamic} value, Widget? child) {",
" return ${4:Container();}",
" },",
" ), "
],
"description": "Widget builder that animates a property of a Widget to a target value whenever the target value changes."
},
"Value Listenable Builder": {
"prefix": "valueListenableBuilder",
"body": [
"ValueListenableBuilder(",
" valueListenable: ${1: null},",
" builder: (BuildContext context, ${2:dynamic} value, Widget? child) {",
" return ${3: Container();}",
" },",
" ),"
],
"description": "Given a ValueListenable<T> and a builder which builds widgets from concrete values of T, this class will automatically register itself as a listener of the ValueListenable and call the builder with updated values when the value changes."
},
"Test": {
"prefix": "f-test",
"body": [
"test(",
" \"${1:test description}\",",
" () {},",
");"
],
"description": "Create a test function"
},
"Test Widgets": {
"prefix": "widgetTest",
"body": [
"testWidgets(",
" \"${1:test description}\",",
" (WidgetTester tester) async {},",
");"
],
"description": "Create a testWidgets function"
}
}

View File

@@ -0,0 +1,526 @@
{
"Show": {
"prefix": "show",
"description": "Output markup: {{ }}",
"body": "{{ $1 }}"
},
"Execute": {
"prefix": "execute",
"description": "Tag markup: {%- -%}",
"body": "{%- $1 -%}"
},
"Tag assign": {
"prefix": "assign",
"description": "Variable tag: assign",
"body": [
"{%- assign ${variable} = ${value} -%}"
]
},
"Tag break": {
"prefix": "break",
"description": "Iteration tag: break",
"body": [
"{%- break -%}"
]
},
"Tag capture": {
"prefix": "capture",
"description": "Variable tag: capture",
"body": [
"{%- capture ${variable} -%}${code:}{%- endcapture -%}"
]
},
"Tag case": {
"prefix": "case",
"description": "Control flow tag: case",
"body": [
"{%- case ${variable} -%}",
"\t{%- when ${condition} -%}",
"\t\t${code1:}",
"\t{%- else -%}",
"\t\t${code2:}",
"{%- endcase -%}"
]
},
"Tag comment": {
"prefix": "comment",
"description": "Control flow tag: case",
"body": [
"{%- comment -%}${description:}{%- endcomment -%}"
]
},
"Tag context variable": {
"prefix": "convar",
"description": "Context Variable",
"body": [
"{{ ${variable:} }}"
]
},
"Tag continue": {
"prefix": "continue",
"description": "Iteration tag: continue",
"body": [
"{%- continue -%}"
]
},
"Tag cycle": {
"prefix": "cycle",
"description": "Iteration tag: cycle",
"body": [
"{%- cycle '${0:odd}', '${1:even}' -%}"
]
},
"Tag collection directory": {
"prefix": "cdirp",
"description": "The full path to the collection's source direcotry",
"body": [
"{{ site.${my_collection}.directory }}"
]
},
"Tag collection relative path": {
"prefix": "crelp",
"description": "The path to the document's source file realtive to the site source",
"body": [
"{{ site.collections.${my_collection}.relative_path }}"
]
},
"Tag decrement": {
"prefix": "decrement",
"description": "Variable tag: decrement",
"body": [
"{%- decrement ${variable} -%}"
]
},
"Tag for": {
"prefix": "for",
"description": "Iteration tag: for",
"body": [
"{%- for ${item} in ${collection} -%}",
"\t${code:}",
"{%- endfor -%}"
]
},
"Tag increment": {
"prefix": "increment",
"description": "Variable tag: increment",
"body": [
"{%- increment ${variable} -%}"
]
},
"Tag if": {
"prefix": "if",
"description": "Control flow tag: if",
"body": [
"{%- if ${condition} -%}",
"\t${code:}",
"{%- endif -%}"
]
},
"Tag else": {
"prefix": "else",
"description": "Control flow tag: else",
"body": [
"{%- else -%}"
]
},
"Tag elsif": {
"prefix": "elsif",
"description": "Control flow tag: elsif",
"body": [
"{%- elsif ${condition} -%}"
]
},
"Tag if else": {
"prefix": "ifelse",
"description": "Control flow tag: if else",
"body": [
"{%- if ${condition} -%}",
"\t${code1:}",
"{%- else -%}",
"\t${code2:}",
"{%- endif -%}"
]
},
"Tag gist": {
"prefix": "gist",
"description": "Add a gist code block",
"body": [
"{%- gist ${gist:user/gist-id} -%}"
]
},
"Tag highlight": {
"prefix": "highlight",
"description": "Syntax tag: highlight",
"body": [
"{%- highlight ${lang:javascript} -%}",
"\t\t${code:}",
"{%- endhighlight -%}"
]
},
"Tag include": {
"prefix": "include",
"description": "Tag: include",
"body": [
"{%- include ${snippet} -%}"
]
},
"Site Vairable Date": {
"prefix": "date",
"description": "Tag: site.date",
"body": [
"{{ site.date | date: '${format: %b %d, %Y}' }}"
]
},
"Tag include relative": {
"prefix": "increl",
"description": "Tag: include relative",
"body": [
"{%- include_relative '${file:}' -%}"
]
},
"Tag Post URL": {
"prefix": "posturl",
"description": "Tag: post_url",
"body": [
"{%- post_url ${url:} -%}"
]
},
"Tag unless": {
"prefix": "unless",
"description": "Control flow tag: unless",
"body": [
"{%- unless ${condition} -%}",
"\t${code:}",
"{%- endunless -%}"
]
},
"Tag when": {
"prefix": "when",
"description": "Control flow tag: when",
"body": [
"{%- when ${condition} -%}",
"${code:}"
]
},
"Tag Option limit": {
"prefix": "limit",
"description": "For loops option",
"body": [
"limit: ${limit:5}"
]
},
"Tag Option offset": {
"prefix": "offset",
"description": "For loops option",
"body": [
"offset: ${offset:0}"
]
},
"Tag Option reversed": {
"prefix": "reversed",
"description": "For loops option",
"body": [
"reversed"
]
},
"Tag raw": {
"prefix": "raw",
"description": "Tag: raw",
"body": [
"{%- raw -%}${code:}{%- endraw -%}"
]
},
"Tag paginate next or previous page": {
"prefix": "paginate",
"description": "Tag: paginate next or previous page",
"body": [
"{{ paginator.${next:previous}_page }}"
]
},
"Filter jsonify": {
"prefix": "json",
"description": "Array filter: jsonify",
"body": "| jsonify }}'"
},
"Filter join": {
"prefix": "join",
"description": "Array filter: join",
"body": "| join: '${seperator:, }}'"
},
"Filter first": {
"prefix": "first",
"description": "Array filter: first",
"body": "| first"
},
"Filter last": {
"prefix": "last",
"description": "Array filter: last",
"body": "| last"
},
"Filter map": {
"prefix": "map",
"description": "Array filter: map",
"body": "| map: '${key}'"
},
"Filter size": {
"prefix": "size",
"description": "Array filter: size",
"body": "| size"
},
"Filter sort": {
"prefix": "sort",
"description": "Array filter: sort",
"body": "| sort"
},
"Filter uniq": {
"prefix": "uniq",
"description": "Array filter: uniq",
"body": "| uniq"
},
"Filter ceil": {
"prefix": "ceil",
"description": "Math filter: ceil",
"body": "| ceil"
},
"Filter divided by": {
"prefix": "divided_by",
"description": "Math filter: divided by",
"body": "| divided_by: ${divided_by:2}"
},
"Filter floor": {
"prefix": "floor",
"description": "Math filter: floor",
"body": "| floor"
},
"Filter minus": {
"prefix": "minus",
"description": "Math filter: minus",
"body": "| minus: ${minus:1}"
},
"Filter modulo": {
"prefix": "modulo",
"description": "Math filter: modulo",
"body": "| modulo: ${modulo:2}"
},
"Filter plus": {
"prefix": "plus",
"description": "Math filter: plus",
"body": "| plus: ${plus:1}"
},
"Filter round": {
"prefix": "round",
"description": "Math filter: round",
"body": "| round: ${round:0}"
},
"Filter times": {
"prefix": "times",
"description": "Math filter: times",
"body": "| times: ${times:1}"
},
"Filter append": {
"prefix": "append",
"description": "String filter: append",
"body": "| append: '${string}' }}"
},
"Filter capitalize": {
"prefix": "capitalize",
"description": "String filter: capitalize",
"body": "| capitalize }}"
},
"Filter downcase": {
"prefix": "downcase",
"description": "String filter: downcase",
"body": "| downcase }}"
},
"Filter escape": {
"prefix": "escape",
"description": "String filter: escape",
"body": "| escape }}"
},
"Filter markdownify": {
"prefix": "markdown",
"description": "String filter: markdownify",
"body": "| markdownify }}"
},
"Filter prepend": {
"prefix": "prepend",
"description": "String filter: prepend",
"body": "| prepend: '${string}' }}"
},
"Filter remove": {
"prefix": "remove",
"description": "String filter: remove",
"body": "| remove: '${string}' }}"
},
"Filter remove first": {
"prefix": "remove_first",
"description": "String filter: remove first",
"body": "| remove_first: '${string}' }}"
},
"Filter replace": {
"prefix": "replace",
"description": "String filter: replace",
"body": "| replace: '${target}', '${replace}' }}"
},
"Filter replace first": {
"prefix": "replace_first",
"description": "String filter: replace first",
"body": "| replace_first: '${target}', '${replace}' }}"
},
"Filter slice": {
"prefix": "slice",
"description": "String filter: slice",
"body": "| slice: ${from:0}, ${to:5} }}"
},
"Filter slice single character": {
"prefix": "slice_single",
"description": "String filter: slice with single parameter",
"body": "| slice: ${at} }}"
},
"Filter split": {
"prefix": "split",
"description": "String filter: split",
"body": "| split: '${splitter:,}' }}"
},
"Filter strip": {
"prefix": "strip",
"description": "String filter: strip",
"body": "| strip }}"
},
"Filter lstrip": {
"prefix": "lstrip",
"description": "String filter: lstrip",
"body": "| lstrip }}"
},
"Filter rstrip": {
"prefix": "rstrip",
"description": "String filter: rstrip",
"body": "| rstrip }}"
},
"Filter strip html": {
"prefix": "strip_html",
"description": "String filter: strip html",
"body": "| strip_html }}"
},
"Filter strip newlines": {
"prefix": "strip_newlines",
"description": "String filter: strip newlines",
"body": "| strip_newlines }}"
},
"Filter truncate": {
"prefix": "truncate",
"description": "String filter: truncate",
"body": "| truncate: ${length:20}, '${ellipsis:...}' }}"
},
"Filter truncatewords": {
"prefix": "truncatewords",
"description": "String filter: truncatewords",
"body": "| truncatewords: ${length:5}, '${ellipsis:...}' }}"
},
"Filter upcase": {
"prefix": "upcase",
"description": "String filter: upcase }}",
"body": "| upcase }}"
},
"Filter url encode": {
"prefix": "url_encode",
"description": "String filter: url encode",
"body": "| url_encode }}"
},
"Filter uri escape": {
"prefix": "uri_escape",
"description": "String filter: uri escape",
"body": "| uri_escape }}"
},
"Filter xml escape": {
"prefix": "xml_escape",
"description": "String filter: xml escape",
"body": "| xml_escape }}"
},
"Front Matter": {
"prefix": "fm",
"description": "Add front matter",
"body": [
"---",
"layout: ${layout:default}",
"title: ${title}",
"categories: ${category}",
"permalink: ${path}",
"tags: ${tag}",
"excerpt: ${description}",
"---"
]
}
}

View File

@@ -0,0 +1,301 @@
{
"Before action": {
"prefix": "ba",
"body": [
"before_action :${0:method}"
],
"description": "before_action"
},
"Before validation": {
"prefix": "bv",
"body": [
"before_validation :${0:method}"
],
"description": "before_validation"
},
"Before create": {
"prefix": "bc",
"body": [
"before_create :${0:method}"
],
"description": "before_create"
},
"Before update": {
"prefix": "bu",
"body": [
"before_update :${0:method}"
],
"description": "before_update"
},
"Before save": {
"prefix": "bs",
"body": [
"before_save :${0:method}"
],
"description": "before_save"
},
"Before destroy": {
"prefix": "bd",
"body": [
"before_destroy :${0:method}"
],
"description": "before_destroy"
},
"After create": {
"prefix": "ac",
"body": [
"after_create :${0:method}"
],
"description": "after_create"
},
"After validation": {
"prefix": "av",
"body": [
"after_validation :${0:method}"
],
"description": "after_validation"
},
" update": {
"prefix": "au",
"body": [
"after_update :${0:method}"
],
"description": "after_update"
},
" save": {
"prefix": "as",
"body": [
"after_save :${0:method}"
],
"description": "after_create"
},
" destroy": {
"prefix": "ad",
"body": [
"after_destroy :${0:method}"
],
"description": "after_destroy"
},
"Belongs to": {
"prefix": "bt",
"body": [
"belongs_to :${0:association}"
],
"description": "belongs_to assocation"
},
"Belongs to polymorphic": {
"prefix": "btp",
"body": [
"belongs_to :${0:association}, polymorphic: true"
],
"description": "belongs_to polymorphic assocation"
},
"Create action": {
"prefix": "create",
"body": [
"def create",
"\t@${1:model_class_name} = ${2:ModelClassName}.new($1_params)",
"\trespond_to do |format|",
"\t\tif @$1.save",
"\t\t\tformat.html { redirect_to @$1, notice: '$2 created' }",
"\t\telse",
"\t\t\tformat.html { render :new, status: :unprocessable_entity }",
"\t\tend",
"\tend",
"end"
],
"description": "def create"
},
"Destroy action": {
"prefix": "destroy",
"body": [
"def destroy",
"\t@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])",
"\t@$1.destroy!",
"\tredirect_to $1s_path, notice: '$2 removed'",
"end"
],
"description": "def destroy"
},
"Edit action": {
"prefix": "edit",
"body": [
"def edit",
"\t@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])",
"end"
],
"description": "def edit"
},
"Index action": {
"prefix": "index",
"body": [
"def index",
"\t@${1:model_class_name} = ${2:ModelClassName}.all",
"end"
],
"description": "def index"
},
"New action": {
"prefix": "new",
"body": [
"def new",
"\t@${1:model_class_name} = ${2:ModelClassName}.new",
"end"
],
"description": "def new"
},
"Show action": {
"prefix": "show",
"body": [
"def show",
"\t@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])",
"end"
],
"description": "def show"
},
"Update action": {
"prefix": "update",
"body": [
"def update",
"\t@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])",
"\trespond_to do |format|",
"\t\tif @$1.update($1_params)",
"\t\t\tformat.html { redirect_to @$1, notice: '$2 updated' }",
"\t\telse",
"\t\t\tformat.html { render :edit, status: :unprocessable_entity }",
"\t\tend",
"\tend",
"end"
],
"description": "def update"
},
"Model Params": {
"prefix": "params",
"body": [
"def ${1:model_class_name}_params",
"\tparams.require(:$1).permit(${2:attributes})",
"end"
],
"description": "def model_params"
},
"Getting Params": {
"prefix": "pa",
"body": [
"params[:${1:id}]"
],
"description": "getting params using attribute"
},
"Delegate to": {
"prefix": "dt",
"body": [
"delegate: :${1:method}, to: :${0:object}"
],
"description": "delegate to"
},
"Delegate to with prefix": {
"prefix": "dtp",
"body": [
"delegate: :${1:method}, to: :${2:object}, prefix: :${3:prefix}, allow_nil: ${0:allow_nil}"
],
"description": "delegate to"
},
"Scope": {
"prefix": "scope",
"body": [
"scope :${1:name}, -> { where(${2:field}: ${0:value}) }"
],
"description": "AR scope"
},
"Validate presence": {
"prefix": "vp",
"body": [
"validates :${1:attribute}, presence: true"
],
"description": "validates presence"
},
"Validate uniqueness": {
"prefix": "vu",
"body": [
"validates :${1:attribute}, uniqueness: true"
],
"description": "validates presence"
},
"Migration add column": {
"prefix": "mac",
"body": [
"add_column :${1:table_name}, :${2:column_name}, :${0:data_type}"
],
"description": "Migration add column"
},
"Migration add index": {
"prefix": "mai",
"body": [
"add_index :${1:table_name}, :${0:column_name}"
],
"description": "Migration add index"
},
"Migration remove column": {
"prefix": "mrc",
"body": [
"remove_column :${1:table_name}, :${0:column_name}"
],
"description": "Migration remove column"
},
"Migration rename column": {
"prefix": "mrnc",
"body": [
"rename_column :${1:table_name}, :${2:old_column_name}, :${0:new_column_name}"
],
"description": "Migration rename column"
},
"Migration change column": {
"prefix": "mcc",
"body": [
"change_column :${1:table_name}, :${2:old_column_name}, :${0:data_type}"
],
"description": "Migration change column"
},
"Has many dependent": {
"prefix": "hmd",
"body": [
"has_many :${1:object}, dependent: :${0:destroy}"
],
"description": "has_many dependent"
},
"Has many": {
"prefix": "hm",
"body": [
"has_many :${0:object}"
],
"description": "has_many association"
},
"Has many through": {
"prefix": "hmt",
"body": [
"has_many :${1:object}, through: :${0:object}"
],
"description": "has_many through association"
},
"Has one": {
"prefix": "ho",
"body": [
"has_one :${0:object}"
],
"description": "has_one association"
},
"Has one dependent": {
"prefix": "hod",
"body": [
"has_one :${1:object}, dependent: :${0:destroy}"
],
"description": "has_one dependent"
},
"Save and open screenshot": {
"prefix": "saos",
"body": [
"save_and_open_screenshot${0}"
],
"description": "save_and_open_screenshot"
}
}

View File

@@ -0,0 +1,192 @@
{
"Relm4 Component": {
"prefix": "relm-component",
"description": "Relm4 Component Widget",
"body": [
"use relm4::{gtk, Component, ComponentSender, ComponentParts};",
"",
"pub struct ComponentModel {}",
"",
"#[derive(Debug)]",
"pub enum ComponentInput {}",
"",
"#[derive(Debug)]",
"pub enum ComponentOutput {}",
"",
"pub struct ComponentInit {}",
"",
"#[relm4::component(pub)]",
"impl Component for ComponentModel {",
" type CommandOutput = ();",
" type Input = ComponentInput;",
" type Output = ComponentOutput;",
" type Init = ComponentInit;",
"",
" view! {",
" #[root]",
" gtk::Box {",
"",
" }",
" }",
"",
" fn init(",
" init: Self::Init,",
" root: &Self::Root,",
" sender: ComponentSender<Self>,",
" ) -> ComponentParts<Self> {",
" let model = ComponentModel {};",
" let widgets = view_output!();",
" ComponentParts { model, widgets }",
" }",
"",
" fn update(&mut self, message: Self::Input, sender: ComponentSender<Self>, root: &Self::Root) {",
" match message {",
"",
" }",
" }",
"}"
]
},
"Relm4 Simple Component": {
"prefix": "relm-simple-component",
"description": "Relm4 SimpleComponent Widget",
"body": [
"use relm4::{gtk, SimpleComponent, ComponentSender, ComponentParts};",
"",
"pub struct ComponentModel {}",
"",
"#[derive(Debug)]",
"pub enum ComponentInput {}",
"",
"#[derive(Debug)]",
"pub enum ComponentOutput {}",
"",
"pub struct ComponentInit {}",
"",
"#[relm4::component(pub)]",
"impl SimpleComponent for ComponentModel {",
" type Input = ComponentInput;",
" type Output = ComponentOutput;",
" type Init = ComponentInit;",
"",
" view! {",
" #[root]",
" gtk::Box {",
"",
" }",
" }",
"",
" fn init(",
" init: Self::Init,",
" root: &Self::Root,",
" sender: ComponentSender<Self>,",
" ) -> ComponentParts<Self> {",
" let model = ComponentModel {};",
" let widgets = view_output!();",
" ComponentParts { model, widgets }",
" }",
"",
" fn update(&mut self, message: Self::Input, sender: ComponentSender<Self>) {",
" match message {",
"",
" }",
" }",
"}"
]
},
"Relm4 Async Component": {
"prefix": "relm-async-component",
"description": "Relm4 Component Widget",
"body": [
"use relm4::{gtk, component::{AsyncComponent, AsyncComponentParts}, AsyncComponentSender};",
"",
"pub struct AsyncComponentModel {}",
"",
"#[derive(Debug)]",
"pub enum AsyncComponentInput {}",
"",
"#[derive(Debug)]",
"pub enum AsyncComponentOutput {}",
"",
"pub struct AsyncComponentInit {}",
"",
"#[relm4::component(pub async)]",
"impl AsyncComponent for AsyncComponentModel {",
" type CommandOutput = ();",
" type Input = AsyncComponentInput;",
" type Output = AsyncComponentOutput;",
" type Init = AsyncComponentInit;",
"",
" view! {",
" #[root]",
" gtk::Box {",
"",
" }",
" }",
"",
" async fn init(",
" init: Self::Init,",
" root: Self::Root,",
" sender: AsyncComponentSender<Self>,",
" ) -> AsyncComponentParts<Self> {",
" let model = AsyncComponentModel {};",
" let widgets = view_output!();",
" AsyncComponentParts { model, widgets }",
" }",
"",
" async fn update(&mut self, message: Self::Input, sender: AsyncComponentSender<Self>, _root: &Self::Root) {",
" match message {",
"",
" }",
" }",
"}"
]
},
"Relm4 Async Simple Component": {
"prefix": "relm-simple-async-component",
"description": "Relm4 SimpleAsyncComponent Widget",
"body": [
"use relm4::{gtk, component::{SimpleAsyncComponent, AsyncComponentParts}, AsyncComponentSender};",
"",
"pub struct AsyncComponentModel {}",
"",
"#[derive(Debug)]",
"pub enum AsyncComponentInput {}",
"",
"#[derive(Debug)]",
"pub enum AsyncComponentOutput {}",
"",
"pub struct AsyncComponentInit {}",
"",
"#[relm4::component(pub async)]",
"impl SimpleAsyncComponent for AsyncComponentModel {",
" type Input = AsyncComponentInput;",
" type Output = AsyncComponentOutput;",
" type Init = AsyncComponentInit;",
"",
" view! {",
" #[root]",
" gtk::Box {",
"",
" }",
" }",
"",
" async fn init(",
" init: Self::Init,",
" root: Self::Root,",
" sender: AsyncComponentSender<Self>,",
" ) -> AsyncComponentParts<Self> {",
" let model = AsyncComponentModel {};",
" let widgets = view_output!();",
" AsyncComponentParts { model, widgets }",
" }",
"",
" async fn update(&mut self, message: Self::Input, sender: AsyncComponentSender<Self>) {",
" match message {",
"",
" }",
" }",
"}"
]
}
}

View File

@@ -0,0 +1,157 @@
{
"Relm4 Factory Component": {
"prefix": "relm-factory",
"description": "Relm4 Factory Component",
"body": [
"use relm4::{",
" factory::FactoryView,",
" gtk,",
" prelude::{DynamicIndex, FactoryComponent},",
" FactorySender,",
"};",
"",
"pub struct FactoryModel {}",
"",
"#[derive(Debug)]",
"pub enum FactoryInput {}",
"",
"#[derive(Debug)]",
"pub enum FactoryOutput {}",
"",
"pub struct FactoryInit {}",
"",
"#[relm4::factory(pub)]",
"impl FactoryComponent for FactoryModel {",
" type ParentWidget = gtk::Box;",
" type ParentInput = ();",
" type Input = FactoryInput;",
" type Output = FactoryOutput;",
" type Init = FactoryInit;",
" type CommandOutput = ();",
"",
" view! {",
" #[root]",
" gtk::Box {",
"",
" }",
" }",
"",
" fn init_model(",
" init: Self::Init,",
" index: &DynamicIndex,",
" sender: FactorySender<Self>,",
" ) -> Self {",
" Self {}",
" }",
"",
" fn init_widgets(",
" &mut self,",
" _index: &DynamicIndex,",
" root: &Self::Root,",
" _returned_widget: &<Self::ParentWidget as FactoryView>::ReturnedWidget,",
" sender: FactorySender<Self>,",
" ) -> Self::Widgets {",
" let widgets = view_output!();",
" widgets",
" }",
"",
" fn update(&mut self, message: Self::Input, sender: FactorySender<Self>) {",
" match message {}",
" }",
"",
" fn output_to_parent_input(output: Self::Output) -> Option<Self::ParentInput> {",
" let output = match output {};",
" Some(output)",
" }",
"}"
]
},
"Relm4 Async Factory Component": {
"prefix": "relm-async-factory",
"description": "Relm4 Async Factory Component",
"body": [
"use relm4::{",
" factory::{FactoryView, AsyncFactoryComponent},",
" gtk,",
" prelude::{DynamicIndex}, ",
" AsyncFactorySender, loading_widgets::LoadingWidgets,",
"};",
"",
"pub struct FactoryModel {}",
"",
"#[derive(Debug)]",
"pub enum FactoryInput {}",
"",
"#[derive(Debug)]",
"pub enum FactoryOutput {}",
"",
"pub struct FactoryInit {}",
"",
"#[relm4::factory(pub async)]",
"impl AsyncFactoryComponent for FactoryModel {",
" type ParentWidget = gtk::Box;",
" type ParentInput = ();",
" type Input = FactoryInput;",
" type Output = FactoryOutput;",
" type Init = FactoryInit;",
" type CommandOutput = ();",
"",
" view! {",
" #[root]",
" gtk::Box {",
"",
" }",
" }",
"",
" fn init_loading_widgets(",
" root: &mut Self::Root,",
" ) -> Option<LoadingWidgets> {",
" relm4::view! {",
" #[local_ref]",
" root {",
" #[name(spinner)]",
" gtk::Spinner {",
" start: ()",
" }",
" }",
" }",
" Some(LoadingWidgets::new(root, spinner))",
" }",
"",
" async fn init_model(",
" init: Self::Init,",
" _index: &DynamicIndex,",
" _sender: AsyncFactorySender<Self>,",
" ) -> Self {",
" Self {",
" ",
" }",
" }",
"",
" fn init_widgets(",
" &mut self,",
" _index: &DynamicIndex,",
" root: &Self::Root,",
" _returned_widget: &<Self::ParentWidget as FactoryView>::ReturnedWidget,",
" sender: AsyncFactorySender<Self>,",
" ) -> Self::Widgets {",
" let widgets = view_output!();",
" widgets",
" }",
"",
" async fn update(",
" &mut self,",
" message: Self::Input,",
" sender: AsyncFactorySender<Self>,",
" ) {",
" match message {}",
" }",
"",
" fn output_to_parent_input(output: Self::Output) -> Option<Self::ParentInput> {",
" let output = match output {};",
" Some(output)",
" }",
"}"
]
}
}

View File

@@ -0,0 +1,18 @@
{
"Relm4 Widget Template": {
"prefix": "relm-template",
"description": "Relm4 Widget Template",
"body": [
"use relm4::{gtk, WidgetTemplate};",
"",
"#[relm4::widget_template]",
"impl WidgetTemplate for Widget {",
" view! {",
" gtk::Box {",
" // Customize your widget",
" }",
" }",
"}"
]
}
}

View File

@@ -0,0 +1,28 @@
{
"Relm4 Worker": {
"prefix": "relm-worker",
"description": "Relm4 Worker",
"body": [
"use relm4::{ComponentSender, Worker};",
"",
"pub struct AsyncHandler;",
"",
"#[derive(Debug)]",
"pub enum AsyncHandlerInput {}",
"",
"impl Worker for AsyncHandler {",
" type Init = ();",
" type Input = AsyncHandlerInput;",
" type Output = ();",
"",
" fn init(_init: Self::Init, _sender: ComponentSender<Self>) -> Self {",
" Self",
" }",
"",
" fn update(&mut self, msg: AsyncHandlerInput, sender: ComponentSender<Self>) {",
" match msg {}",
" }",
"}"
]
}
}

View File

@@ -0,0 +1,536 @@
{
"asset": {
"prefix": "asset",
"body":
"{% set asset = ${1:entry.assetFieldHandle}.one() %}\n\n{% if asset %}\n\t<img src=\"{{ asset.getUrl(\"${2:thumb}\") }}\" width=\"{{ asset.getWidth(\"${2:thumb}\") }}\" height=\"{{ asset.getHeight(\"${2:thumb}\") }}\" alt=\"{{ asset.title }}\">\n{% endif %}",
"description": "asset"
},
"assets": {
"prefix": "assets",
"body":
"{% for image in craft.assets.\n\t.sourceId(\"${1:1}\")\n\t.kind(\"${2:image}\")\n\t.limit(${3:10})\n}).all() %}\n\t<img src=\"{{ image.url${4:(\"${5:thumb}\")} }}\" width=\"${6:200}\" height=\"${7:200}\" alt=\"{{ image.title }}\">\n{% endfor %}\n$0",
"description": "craft.assets"
},
"autoescape": {
"prefix": "autoescape",
"body": "{% autoescape \"${1:type}\" %}\n\t$0\n{% endautoescape %}",
"description": "autoescape"
},
"blockb": {
"prefix": "blockb",
"body": "{% block ${1:name} %}\n\t$0\n{% endblock %}",
"description": "block (block)"
},
"block": {
"prefix": "block",
"body": "{% block ${1:name} %}$0{% endblock %}",
"description": "block"
},
"blockf": {
"prefix": "blockf",
"body": "{{ block(\"${1:name}\") }}$0",
"description": "blockf"
},
"cache": {
"prefix": "cache",
"body": "{% cache %}\n\t$1\n{% endcache %}\n$0",
"description": "cache"
},
"case": {
"prefix": "case",
"body": "{% case \"${1:value}\" %}\n\t$0",
"description": "case"
},
"children": {
"prefix": "children",
"body": "{% children %}$0",
"description": "children"
},
"ceil": {
"prefix": "ceil",
"body": "ceil($1)$0",
"description": "ceil"
},
"assetso": {
"prefix": "assetso",
"body":
"{% set assets = craft.assets({\n\tsourceId: \"${1:1}\",\n\tkind: \"${2:image}\",\n\tlimit: ${3:10}\n}).all() %}\n\n{% for image in assets %}\n\t<img src=\"{{ image.url${4:(\"${5:thumb}\")} }}\" width=\"${6:200}\" height=\"${7:200}\" alt=\"{{ image.title }}\">\n{% endfor %}\n$0",
"description": "craft.assets - object syntax"
},
"categorieso": {
"prefix": "categorieso",
"body":
"{% set categories = craft.categories({\n\tgroup: \"${1:categoryGroupHandle}\",\n\tlimit: \"${2:11}\"\n}).all() %}\n\n<ul>\n\t{% nav category in categories %}\n\t\t<li>\n\t\t\t<a href=\"{{ category.url }}\">{{ category.title }}</a>\n\t\t\t{% ifchildren %}\n\t\t\t\t<ul>\n\t\t\t\t\t{% children %}\n\t\t\t\t</ul>\n\t\t\t{% endifchildren %}\n\t\t</li>\n\t{% endnav %}\n</ul>",
"description": "craft.categories - object syntax"
},
"categories": {
"prefix": "categories",
"body":
"<ul>\n\t{% nav category in craft.categories\n\t\t.group(\"${1:categoryGroupHandle}\")\n\t\t.limit(${2:11})\n\t\t.all()\n\t%}\n\t\t<li>\n\t\t\t<a href=\"{{ category.url }}\">{{ category.title }}</a>\n\t\t\t{% ifchildren %}\n\t\t\t\t<ul>\n\t\t\t\t\t{% children %}\n\t\t\t\t</ul>\n\t\t\t{% endifchildren %}\n\t\t</li>\n\t{% endnav %}\n</ul>",
"description": "craft.categories"
},
"entrieso": {
"prefix": "entrieso",
"body":
"{% set entries = craft.entries({\n\tsection: \"${1:sectionName}\",\n\tlimit: \"${2:10}\"\n}).all() %}\n\n{% for entry in entries %}\n\t<a href=\"{{ entry.url }}\">{{ entry.title }}</a>\n{% endfor %}\n$0",
"description": "craft.entries - object syntax"
},
"entries": {
"prefix": "entries",
"body":
"{% for entry in craft.entries\n\t.section(\"${1:sectionName}\")\n\t.limit(${2:10})\n\t.all()\n%}\n\t<a href=\"{{ entry.url }}\">{{ entry.title }}</a>\n{% endfor %}\n$0",
"description": "craft.entries"
},
"t": {
"prefix": "t",
"body": "{{ $1 | t }}$0",
"description": "translate with | t"
},
"replace": {
"prefix": "replace",
"body": "{{ ${1:$TM_SELECTED_TEXT} | replace(\"search\", \"replace\") }}$0",
"description": "replace with | replace(\"search\", \"replace\")"
},
"replacex": {
"prefix": "replacex",
"body":
"{{ ${1:$TM_SELECTED_TEXT} | replace(\"/(search)/i\", \"replace\") }}$0",
"description": "replace regex with | replace(\"/(search)/i\", \"replace\")"
},
"split": {
"prefix": "split",
"body": "{{ ${1:$TM_SELECTED_TEXT} | split(\"\\n\") }}$0",
"description": "split on | split (\"\\n\")"
},
"tagso": {
"prefix": "tagso",
"body":
"{% set tags = craft.tags({\n\tgroup: \"${1:tagGroupHandle}\"\n}).all() %}\n\n<ul>\n\t{% for tag in tags %}\n\t\t<li>{{ tag }}</a></li>\n\t{% endfor %}\n</ul>\n$0",
"description": "craft.tags - object syntax"
},
"tags": {
"prefix": "tags",
"body":
"<ul>\n\t{% for tag in craft.tags.group(\"${1:tagGroupHandle}\").all() %}\n\t\t<li>{{ tag }}</li>\n\t{% endfor %}\n</ul>\n$0",
"description": "craft.tags"
},
"userso": {
"prefix": "userso",
"body":
"{% set users = craft.users({\n\tgroup: \"${1:userGroupHandle}\"\n}).all() %}\n\n{% for user in users %}\n\t{{ user.firstName }} {{ user.lastName }}\n{% endfor %}\n$0",
"description": "craft.users - object syntax"
},
"users": {
"prefix": "users",
"body":
"{% for user in craft.users.group(\"${1:userGroupHandle}\").all() %}\n\t{{ user.firstName }} {{ user.lastName }}\n{% endfor %}\n$0",
"description": "craft.users"
},
"csrf": {
"prefix": "csrf",
"body": "{{ csrfInput() }}\n$0",
"description": "csrf"
},
"dd": {
"prefix": "dd",
"body": "<pre>\n\t{{ dump($1) }}\n</pre>\n{% exit %}$0",
"description": "dump and die"
},
"do": {
"prefix": "do",
"body": "{% do $1 %}$0",
"description": "do"
},
"dojs": {
"prefix": "dojs",
"body": "{% do view.registerJsFile \"${1:url}\" %}$0",
"description": "do js"
},
"docss": {
"prefix": "docss",
"body": "{% do view.registerCssFile \"${1:url}\" %}$0",
"description": "do css"
},
"dump": {
"prefix": "dump",
"body": "<pre>\n\t{{ dump($1) }}\n</pre>",
"description": "dump"
},
"else": {
"prefix": "else",
"body": "{% else %}\n\t$0",
"description": "else"
},
"embed": {
"prefix": "embed",
"body": "{% embed \"${1:template}\" %}\n\t$0\n{% endembed %}",
"description": "embed"
},
"endautoescape": {
"prefix": "endautoescape",
"body": "{% endautoescape %}$0",
"description": "endautoescape"
},
"endblock": {
"prefix": "endblock",
"body": "{% endblock %}$0",
"description": "endblock"
},
"endcache": {
"prefix": "endcache",
"body": "{% endcache %}$0",
"description": "endcache"
},
"endembed": {
"prefix": "endembed",
"body": "{% endembed %}$0",
"description": "endembed"
},
"endfilter": {
"prefix": "endfilter",
"body": "{% endfilter %}$0",
"description": "endfilter"
},
"endfor": {
"prefix": "endfor",
"body": "{% endfor %}$0",
"description": "endfor"
},
"endif": {
"prefix": "endif",
"body": "{% endif %}$0",
"description": "endif"
},
"endifchildren": {
"prefix": "endifchildren",
"body": "{% endifchildren %}$0",
"description": "endifchildren"
},
"endcss": {
"prefix": "endcss",
"body": "{% endcss %}$0",
"description": "endcss"
},
"endjs": {
"prefix": "endjs",
"body": "{% endjs %}$0",
"description": "endjs"
},
"endmacro": {
"prefix": "endmacro",
"body": "{% endmacro %}$0",
"description": "endmacro"
},
"endnav": {
"prefix": "endnav",
"body": "{% endnav %}$0",
"description": "endnav"
},
"endset": {
"prefix": "endset",
"body": "{% endset %}$0",
"description": "endset"
},
"endspaceless": {
"prefix": "endspaceless",
"body": "{% endspaceless %}$0",
"description": "endspaceless"
},
"endswitch": {
"prefix": "endswitch",
"body": "{% endswitch %}$0",
"description": "endswitch"
},
"endtrans": {
"prefix": "endtrans",
"body": "{% endtrans %}$0",
"description": "endtrans"
},
"endverbatim": {
"prefix": "endverbatim",
"body": "{% endverbatim %}$0",
"description": "endverbatim"
},
"exit": {
"prefix": "exit",
"body": "{% exit ${1:404} %}",
"description": "exit"
},
"extends": {
"prefix": "extends",
"body": "{% extends \"${1:template}\" %}$0",
"description": "extends"
},
"filterb": {
"prefix": "filterb",
"body": "{% filter ${1:name} %}\n\t$0\n{% endfilter %}",
"description": "filter (block)"
},
"filter": {
"prefix": "filter",
"body": "{% filter ${1:name} %}$0{% endfilter %}",
"description": "filter"
},
"floor": {
"prefix": "floor",
"body": "floor($1)$0",
"description": "floor"
},
"fore": {
"prefix": "fore",
"body":
"{% for ${1:item} in ${2:items} %}\n\t$3\n{% else %}\n\t$0\n{% endfor %}",
"description": "for ... else"
},
"for": {
"prefix": "for",
"body": "{% for ${1:item} in ${2:items} %}\n\t$0\n{% endfor %}",
"description": "for"
},
"from": {
"prefix": "from",
"body": "{% from \"${1:template}\" import \"${2:macro}\" %}$0",
"description": "from"
},
"endbody": {
"prefix": "endbody",
"body": "{{ endBody() }}\n$0",
"description": "endBody"
},
"head": {
"prefix": "head",
"body": "{{ head() }}\n$0",
"description": "head"
},
"if": {
"prefix": "if",
"body": "{% if ${1:condition} %}$2{% endif %}\n$0",
"description": "if"
},
"ifb": {
"prefix": "ifb",
"body": "{% if ${1:condition} %}\n\t$0\n{% endif %}",
"description": "if (block)"
},
"ife": {
"prefix": "ife",
"body": "{% if ${1:condition} %}\n\t$2\n{% else %}\n\t$0\n{% endif %}",
"description": "if ... else"
},
"if1": {
"prefix": "if",
"body": "{% if ${1:condition} %}$0{% endif %}",
"description": "if"
},
"ifchildren": {
"prefix": "ifchildren",
"body": "{% ifchildren %}\n\t$1\n{% endifchildren %}\n$0",
"description": "ifchildren"
},
"import": {
"prefix": "import",
"body": "{% import \"${1:template}\" as ${2:name} %}$0",
"description": "import"
},
"importself": {
"prefix": "importself",
"body": "{% import _self as ${1:name} %}$0",
"description": "importself"
},
"inckv": {
"prefix": "inckv",
"body":
"{% include \"${1:template}\" with {\n\t${2:key}: ${3:\"${4:value}\"}\n} %}\n$0",
"description": "include w/ key/value"
},
"include": {
"prefix": "include",
"body": "{% include \"${1:template}\" %}$0",
"description": "include"
},
"inc": {
"prefix": "inc",
"body": "{% include \"${1:template}\" %}$0",
"description": "inc"
},
"incp": {
"prefix": "incp",
"body": "{% include \"${1:template}\"${2: with ${3:params} }%}$0",
"description": "include w/ params"
},
"css1": {
"prefix": "css",
"body": "{% do view.registerCssFile(\"${1:/resources/css/global.css}\") %}\n$0",
"description": "registerCssFile"
},
"js": {
"prefix": "js",
"body": "{% js %}\n\t$1\n{% endjs %}\n$0",
"description": "js"
},
"js1": {
"prefix": "js",
"body": "{% do view.registerJsFile(\"${1:/resources/js/global.js}\") %}\n$0",
"description": "registerJsFile"
},
"css": {
"prefix": "css",
"body": "{% css %}\n\t$1\n{% endcss %}\n$0",
"description": "css"
},
"macro": {
"prefix": "macro",
"body": "{% macro ${1:name}(${2:params}) %}\n\t$0\n{% endmacro %}",
"description": "macro"
},
"matrix": {
"prefix": "matrix",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% if block.type == \"${2:blockHandle}\" %}\n\t\t{{ block.${3:fieldHandle} }}\n\t{% endif %}\n\n\t{% if block.type == \"${4:blockHandle}\" %}\n\t\t{{ block.${5:fieldHandle} }}\n\t{% endif %}\n\n{% endfor %}\n$0",
"description": "matrix"
},
"matrixif": {
"prefix": "matrixif",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% if block.type == \"${2:blockHandle}\" %}\n\t\t{{ block.${3:fieldHandle} }}\n\t{% endif %}\n\n\t{% if block.type == \"${4:blockHandle}\" %}\n\t\t{{ block.${5:fieldHandle} }}\n\t{% endif %}\n\n{% endfor %}\n$0",
"description": "matrixif"
},
"matrixifelse": {
"prefix": "matrixifelse",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% if block.type == \"${2:blockHandle}\" %}\n\n\t\t{{ block.${3:fieldHandle} }}\n\n\t{% elseif block.type == \"${4:blockHandle}\" %}\n\n\t\t$0\n\t\n\t{% endif %}\n\n{% endfor %}",
"description": "matrixifelse"
},
"matrixswitch": {
"prefix": "matrixswitch",
"body":
"{% for block in ${1:entry.matrixFieldHandle}.all() %}\n\n\t{% switch block.type %}\n\n\t\t{% case \"${2:blockHandle}\" %}\n\n\t\t\t{{ block.${3:fieldHandle} }}\n\n\t\t{% case \"${4:blockHandle}\" %}\n\n\t\t\t$0\n\n\t{% endswitch %}\n\n{% endfor %}",
"description": "matrixswitch"
},
"max": {
"prefix": "max",
"body": "max(${1:$2, $3})$0",
"description": "max"
},
"min": {
"prefix": "min",
"body": "min(${1:$2, $3})$0",
"description": "min"
},
"nav": {
"prefix": "nav",
"body": "{% nav ${1:item} in ${2:items} %}\n\t$3\n{% endnav %}\n$0",
"description": "nav"
},
"paginate": {
"prefix": "paginate",
"body":
"{% paginate ${1:elements} as ${2:pageInfo}, ${3:pageEntries} %}\n\n{% for item in ${3:pageEntries} %}\n\t$0\n{% endfor %}\n\n{% if ${2:pageInfo}.prevUrl %}<a href=\"{{ ${2:pageInfo}.prevUrl }}\">Previous Page</a>{% endif %}\n{% if ${2:pageInfo}.nextUrl %}<a href=\"{{ ${2:pageInfo}.nextUrl }}\">Next Page</a>{% endif %}",
"description": "paginate simple"
},
"paginate1": {
"prefix": "paginate",
"body":
"{# PAGINATION\n\t\t\nFor this pagination to work properly, we need to be sure to set\nthe paginateBase variable in the template we are including the \npagination in.\n\n{% set paginateBase = \"/blog/p\" %}\n#}\n\n{% if pageInfo.totalPages > 1 %}\n<ul>\n\t{% if pageInfo.currentPage != \"1\" %}\n\t\t<li><a href=\"{{ paginateBase ~ \"1\" }}\">First Page</a></li>\n\t{% endif %}\n\n\t{% if pageInfo.prevUrl %}\n\t\t<li><a href=\"{{ pageInfo.prevUrl }}\">Previous Page</a></li>\n\t{% endif %}\n\n\t{% for pageNumber in 1..pageInfo.totalPages %}\n\t\t<li {% if pageInfo.currentPage == pageNumber %}class=\"active-page\"{% endif %}>\n\t\t\t<a href=\"{{ paginateBase ~ pageNumber }}\">{{ pageNumber }}</a>\n\t\t</li>\n\t{% endfor %}\n\n\t{% if pageInfo.nextUrl %}\n\t\t<li><a href=\"{{ pageInfo.nextUrl }}\">Next Page</a></li>\n\t{% endif %}\n\n\t{% if pageInfo.currentPage != pageInfo.total %}\n\t\t<li><a href=\"{{ paginateBase ~ pageInfo.total }}\">Last Page</a></li>\n\t{% endif %}\n</ul>\n{% endif %}\n$0",
"description": "paginate advanced"
},
"redirect": {
"prefix": "redirect",
"body":
"{% redirect \"${1:template/path or http://straightupcraft.com}\" %}\n$0",
"description": "redirect"
},
"getparam": {
"prefix": "getparam",
"body":
"craft.app.request.getParam(${1:\"Query String or Post Variable Name\"})\n$0",
"description": "request getParam"
},
"getbodyparam": {
"prefix": "getbodyparam",
"body": "craft.app.request.getBodyParam(${1:\"postVariableName\"})\n$0",
"description": "request getBodyParam"
},
"getqueryparam": {
"prefix": "getqueryparam",
"body": "craft.app.request.getQueryParam(${1:\"queryStringName\"})\n$0",
"description": "request getQueryParam"
},
"getsegment": {
"prefix": "getsegment",
"body": "craft.app.request.getSegment(${1:2})\n$0",
"description": "request getSegment"
},
"requirelogin": {
"prefix": "requirelogin",
"body": "{% requireLogin %}\n$0",
"description": "requireLogin"
},
"requirepermission": {
"prefix": "requirepermission",
"body": "{% requirePermission \"${1:spendTheNight}\" %}\n$0",
"description": "requirePermission"
},
"round": {
"prefix": "round",
"body": "{{ $1 | round(1, 'floor') }}$0",
"description": "round"
},
"setb": {
"prefix": "setb",
"body": "{% set ${1:var} %}\n\t$0\n{% endset %}",
"description": "set (block)"
},
"set": {
"prefix": "set",
"body": "{% set ${1:var} = ${2:value} %}$0",
"description": "set"
},
"shuffle": {
"prefix": "shuffle",
"body": "shuffle($1)$0",
"description": "shuffle"
},
"random": {
"prefix": "random",
"body": "random($1)$0",
"description": "random"
},
"spaceless": {
"prefix": "spaceless",
"body": "{% spaceless %}\n\t$0\n{% endspaceless %}",
"description": "spaceless"
},
"switch": {
"prefix": "switch",
"body":
"{% switch ${1:variable} %}\n\n\t{% case \"${2:value1}\" %}\n\t\n\n\t{% case \"${3:value2}\" %}\n\t\n\n\t{% default %}\n\t\n\n{% endswitch %}\n$0",
"description": "switch"
},
"trans": {
"prefix": "trans",
"body": "{% trans %}$0{% endtrans %}",
"description": "trans"
},
"urla": {
"prefix": "urla",
"body":
"url(\"${1:path}\", ${2:{foo:\"1\", bar:\"2\"\\}}, ${3:\"http\"}, ${4:false})$0",
"description": "url w/ arguments"
},
"url": {
"prefix": "url",
"body": "url(\"${1:path}\")$0",
"description": "url"
},
"use": {
"prefix": "use",
"body": "{% use \"${1:template}\" %}$0",
"description": "use"
},
"verbatim": {
"prefix": "verbatim",
"body": "{% verbatim %}\n\t$0\n{% endverbatim %}",
"description": "verbatim"
}
}

View File

@@ -0,0 +1,434 @@
{
"Unreal Print String": {
"prefix": "uprintstring",
"body": "GEngine->AddOnScreenDebugMessage(0, ${1:0.f}, FColor::${2|Red,Green,Blue,Cyan,Magenta,Yellow,Purple,Orange|}, FString::Printf(TEXT(\"${3:TEXT}\")));",
"description": "Print a string to screen ingame (duration, color, text)"
},
"Write to Log": {
"prefix": "ulog",
"body": "UE_LOG(LogTemp, ${1|Display,Warning,Error,Fatal|}, TEXT(\"${2:Your message}\"));",
"description": "Write a message to the log"
},
"Write to Log (with fn helper)": {
"prefix": "ulogfn",
"body": "UE_LOG(LogTemp, ${1|Display,Warning,Error,Fatal|}, TEXT(\"$2%s\"), ANSI_TO_TCHAR(__FUNCTION__));",
"description": "Write a message to the log"
},
"Unreal Enum": {
"prefix": "uenum",
"body": [
"UENUM(BlueprintType)",
"enum class ${1:EName} : ${2:uint8}",
"{",
"\t${3:N_Name1} UMETA(DisplayName=\"${4:DisplayName}\")",
"};"
],
"description": "Generate an Enum ready for Unreal Engine"
},
"Unreal Struct": {
"prefix": "ustruct",
"body": [
"USTRUCT(BlueprintType)",
"struct ${1:FMyStruct}",
"{",
"\tGENERATED_USTRUCT_BODY()\n",
"\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=${2:MyCategory})",
"\t${3:float test};",
"};"
],
"description": "Generate a Struct ready for Unreal Engine"
},
"Unreal Struct with header": {
"prefix": "uhstruct",
"body": [
"#pragma once",
"",
"#include \"CoreMinimal.h\"",
"",
"#include \"$2${TM_FILENAME_BASE:StructName}.generated.h\"",
"USTRUCT(BlueprintType)",
"struct F$1${TM_FILENAME_BASE:StructName}",
"{",
"\tGENERATED_BODY()\n",
"public:",
"\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"${3:MyCategory}\")",
"\t${4:float test};",
"};"
],
"description": "Generate a Struct ready for Unreal Engine"
},
"Unreal DataTable Struct": {
"prefix": "ustruct_datatable",
"body": [
"USTRUCT(BlueprintType)",
"struct ${1:FMyStruct} : public FTableRowBase",
"{",
"\tGENERATED_USTRUCT_BODY()\n",
"\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=${2:MyCategory})",
"\t${3:float test};",
"};"
],
"description": "Generate a Struct ready for Unreal Engine DataTables"
},
"Unreal Class": {
"prefix": "uclass",
"body": [
"UCLASS()",
"class ${1:PROJECTNAME}_API ${2:ClassName} : public ${3:ParentClass}",
"{",
"\tGENERATED_BODY()",
"public:",
"\t${2:ClassName}();",
"protected:",
"private:",
"};"
],
"description": "Generate a Class ready for Unreal Engine"
},
"Unreal Class with header": {
"prefix": "uhclass",
"body": [
"#pragma once",
"",
"#include \"CoreMinimal.h\"",
"#include \"$4${3:ParentClass}.h\"",
"",
"#include \"${TM_FILENAME_BASE:ClassName}.generated.h\"",
"",
"UCLASS()",
"class ${1:PROJECTNAME}_API $2${TM_FILENAME_BASE:ClassName} : public ${3:ParentClass}",
"{",
"\tGENERATED_BODY()",
"public:",
"\t$2${TM_FILENAME_BASE:ClassName}();",
"$5",
"protected:",
"private:",
"};"
],
"description": "Generate a Class ready for Unreal Engine (include headers details)"
},
"Unreal Interface": {
"prefix": "uinterface",
"body": [
"UINTERFACE()",
"class ${1:PROJECTNAME}_API U${2:ClassName} : public UInterface",
"{",
"\tGENERATED_BODY()",
"};",
"",
"class ${1:PROJECTNAME}_API I${2:ClassName}",
"{",
"\tGENERATED_BODY()",
"public:",
"$3",
"};"
],
"description": "Generate an Interface ready for Unreal Engine"
},
"Unreal Interface with header": {
"prefix": "uhinterface",
"body": [
"#pragma once",
"",
"#include \"CoreMinimal.h\"",
"",
"#include \"${TM_FILENAME_BASE:ClassName}.generated.h\"",
"",
"UINTERFACE()",
"class ${1:PROJECTNAME}_API U$2${TM_FILENAME_BASE:ClassName} : public UInterface",
"{",
"\tGENERATED_BODY()",
"};",
"",
"class ${1:PROJECTNAME}_API I$2${TM_FILENAME_BASE:ClassName}",
"{",
"\tGENERATED_BODY()",
"public:",
"$3",
"};"
],
"description": "Generate an Interface ready for Unreal Engine (include headers details)"
},
"Unreal GetLifeTimeReplicates": {
"prefix": ["ugetlifetimereplicatedprops", "usetupreplicatedproperties"],
"body": [
"void ${1:ClassName}::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const",
"{",
"\tSuper::GetLifetimeReplicatedProps(OutLifetimeProps);",
"\t//DON'T FORGET TO #include \"Net/UnrealNetwork.h\"",
"\tDOREPLIFETIME(${1:ClassName}, ${2:ClassProperty});",
"}"
],
"description": "Creates the Function in which you setup replicated properties"
},
"Unreal Cast": {
"prefix": "ucast",
"body": "${1:AMyClass}* ${2:MyCastActor} = Cast<${1:AMyClass}>(${3:MyActor});",
"description": "Cast from-to any UObject"
},
"Unreal Property": {
"prefix": "uproperty",
"body": "UPROPERTY(${1|AdvancedDisplay,AssetRegistrySearchable,BlueprintAssignable,BlueprintAuthorityOnly,BlueprintCallable,BlueprintGetter=GetterFunctionName,BlueprintReadOnly,BlueprintReadWrite,BlueprintSetter=SetterFunctionName,Category=\"MyCategory\",Config,DuplicateTransient,EditAnywhere,EditDefaultsOnly,EditFixedSize,EditInline,EditInstanceOnly,Export,GlobalConfig,Instanced,Interp,Localized,Native,NoClear,NoExport,NonPIEDuplicateTransient,NonTransactional,NotReplicated,Replicated,ReplicatedUsing=FunctionName,RepRetry,SaveGame,SerializeText,SkipSerialization,SimpleDisplay,TextExportTransient,Transient,VisibleAnywhere,VisibleDefaultsOnly,VisibleInstanceOnly|})",
"description": "UPROPERTY macro for Unreal Engine"
},
"Unreal Function": {
"prefix": "ufunction",
"body": "UFUNCTION($1)",
"description": "UFUNCTION macro for Unreal Engine"
},
"Unreal Server Function": {
"prefix": "ufunction_server",
"body": [
"UFUNCTION(Server, Reliable, WithValidation)",
"void ${1:FunctionName}(${2:FunctionParameters});"
],
"description": "Setup Function run only on Server"
},
"Unreal Multicast Function": {
"prefix": "ufunction_multicast",
"body": [
"UFUNCTION(NetMulticast, Reliable, WithValidation)",
"void ${1:FunctionName}(${2:FunctionParameters});"
],
"description": "Setup Function called on all Clients"
},
"Unreal Client Function": {
"prefix": "ufunction_client",
"body": [
"UFUNCTION(Client, Unreliable)",
"void ${1:FunctionName}(${2:FunctionParameters});"
],
"description": "Setup Function run only on owning Client"
},
"Unreal Subclass": {
"prefix": "usubclassof",
"body": "TSubclassOf<class ${1:ClassName}> ${2:VarName};",
"description": "Reference to Class (assign using \"AMyClass::StaticClass()\")"
},
"Unreal DefaultSubobject": {
"prefix": "ucreatedefaultsubobject",
"body": "${1:ObjectName} = CreateDefaultSubobject<${2:ObjectClass}>(TEXT(\"${1:ObjectName}\"));",
"description": "Creates Subobject (component)"
},
"Unreal GetWorldSafe": {
"prefix": "ugetworldsafe",
"body": ["UWorld* World = GetWorld();", "if(World)", "{", "\t$1", "}"],
"description": "Get World (safe with if check)"
},
"Unreal GetGamemode": {
"prefix": "ugetgamemode",
"body": "${1:GameModeClass}* ${2:gm} = GetWorld()->GetAuthGameMode<${1:GameModeClass}>();",
"description": "Get Game Mode (only on server!)"
},
"Unreal Linetrace Single Channel": {
"prefix": "ulinetrace_single_channel",
"body": "GetWorld()->LineTraceSingleByChannel(${1:Hit}, ${2:Start}, ${3:End}, ${4|ECC_Visibility,ECC_Camera,ECC_GameTraceChannel1|}, ${5:TraceParams});",
"description": "Single Line Trace by Channel"
},
"Unreal Linetrace Single Object": {
"prefix": "ulinetrace_single_object",
"body": "GetWorld()->LineTraceSingleByObjectType(${1:Hit}, ${2:Start}, ${3:End}, ${4:ObjectQueryParams}, ${5:TraceParams});",
"description": "Single Line Trace by Object Type"
},
"Unreal Linetrace Single Profile": {
"prefix": "ulinetrace_single_profile",
"body": "GetWorld()->LineTraceSingleByProfile(${1:Hit}, ${2:Start}, ${3:End}, \"${4:ProfileName}\", ${5:TraceParams});",
"description": "Single Line Trace by Profile"
},
"Unreal Linetrace Multi Channel": {
"prefix": "ulinetrace_multi_channel",
"body": "GetWorld()->LineTraceMultiByChannel(${1:HitsArray}, ${2:Start}, ${3:End}, ${4|ECC_Visibility,ECC_Camera,ECC_GameTraceChannel1|}, ${5:TraceParams});",
"description": "Multi Line Trace by Channel"
},
"Unreal Linetrace Multi Object": {
"prefix": "ulinetrace_multi_object",
"body": "GetWorld()->LineTraceMultiByObjectType(${1:HitsArray}, ${2:Start}, ${3:End}, ${4:ObjectQueryParams}, ${5:TraceParams});",
"description": "Single Line Trace by Object Type"
},
"Unreal Linetrace Multi Profile": {
"prefix": "ulinetrace_multi_profile",
"body": "GetWorld()->LineTraceMultiByProfile(${1:HitsArray}, ${2:Start}, ${3:End}, \"${4:ProfileName}\", ${5:TraceParams});",
"description": "Single Line Trace by Profile"
},
"Unreal Sweep Single Channel": {
"prefix": "usweep_single_channel",
"body": "GetWorld()->SweepSingleByChannel(${1:Hit}, ${2:Start}, ${3:End}, ${4:FQuat::Identity}, ${5|ECC_Visibility,ECC_Camera,ECC_GameTraceChannel1|}, FCollisionShape::${6:MakeSphere(Radius)}, ${7:TraceParams});",
"description": "Trace a Shape against the world and return first blocking hit using Collision Channel."
},
"Unreal Sweep Single Object": {
"prefix": "usweep_single_object",
"body": "GetWorld()->SweepSingleByObjectType(${1:Hit}, ${2:Start}, ${3:End}, ${4:FQuat::Identity}, ${5:ObjectQueryParams}, FCollisionShape::${6:MakeSphere(Radius)}, ${7:TraceParams});",
"description": "Trace a Shape against the world and return first blocking hit using Object Type."
},
"Unreal Sweep Single Profile": {
"prefix": "usweep_single_profile",
"body": "GetWorld()->SweepSingleByProfile(${1:Hit}, ${2:Start}, ${3:End}, ${4:FQuat::Identity}, \"${5:ProfileName}\", FCollisionShape::${6:MakeSphere(Radius)}, ${7:TraceParams});",
"description": "Trace a Shape against the world and return first blocking hit using Collision Profile."
},
"Unreal Sweep Multi Channel": {
"prefix": "usweep_multi_channel",
"body": "GetWorld()->SweepMultiByChannel(${1:HitsArray}, ${2:Start}, ${3:End}, ${4:FQuat::Identity}, ${5|ECC_Visibility,ECC_Camera,ECC_GameTraceChannel1|}, FCollisionShape::${6:MakeSphere(Radius)}, ${7:TraceParams});",
"description": "Trace a Shape against the world and return all blocking hits using Collision Channel."
},
"Unreal Sweep Multi Object": {
"prefix": "usweep_multi_object",
"body": "GetWorld()->SweepMultiByObjectType(${1:HitsArray}, ${2:Start}, ${3:End}, ${4:FQuat::Identity}, ${5:ObjectQueryParams}, FCollisionShape::${6:MakeSphere(Radius)}, ${7:TraceParams});",
"description": "Trace a Shape against the world and return all blocking hits using Object Type."
},
"Unreal Sweep Multi Profile": {
"prefix": "usweep_multi_profile",
"body": "GetWorld()->SweepMultiByProfile(${1:HitsArray}, ${2:Start}, ${3:End}, ${4:FQuat::Identity}, \"${5:ProfileName}\", FCollisionShape::${6:MakeSphere(Radius)}, ${7:TraceParams});",
"description": "Trace a Shape against the world and return all blocking hits using Collision Profile."
},
"Unreal Overlap Multi Channel": {
"prefix": "uoverlap_multi_channel",
"body": "GetWorld()->OverlapMultiByChannel(${1:OverlapsArray}, ${2:Location}, ${3:FQuat::Identity}, ${4|ECC_Visibility,ECC_Camera,ECC_GameTraceChannel1|}, FCollisionShape::${5:MakeSphere(Radius)}, ${6:TraceParams});",
"description": "Trace shape against world and return all overlapping actors using Collision Channel"
},
"Unreal Overlap Multi Object": {
"prefix": "uoverlap_multi_object",
"body": "GetWorld()->OverlapMultiByObjectType(${1:OverlapsArray}, ${2:Location}, ${3:FQuat::Identity}, ${4:ObjectQueryParams}, FCollisionShape::${5:MakeSphere(Radius)}, ${6:TraceParams});",
"description": "Trace shape against world and return all overlapping actors using Collision Channel"
},
"Unreal Overlap Multi Profile": {
"prefix": "uoverlap_multi_profile",
"body": "GetWorld()->OverlapMultiByProfile(${1:OverlapsArray}, ${2:Location}, ${3:FQuat::Identity}, \"${4:ProfileName}\", FCollisionShape::${5:MakeSphere(Radius)}, ${6:TraceParams});",
"description": "Trace shape against world and return all overlapping actors using Collision Channel"
},
"Unreal SpawnActor": {
"prefix": "uspawn_actor",
"body": "${1:AClass}* ${2:ActorName} = GetWorld()->SpawnActor<${1:AClass}>(${3:UClass}, ${4:Location}, ${5:Rotation});",
"description": "Spawn Actor"
},
"Unreal SpawnActorDeferred": {
"prefix": "uspawn_actor_deferred",
"body": [
"${1:AClass}* ${2:ActorName} = GetWorld()->SpawnActorDeferred<${1:AClass}>(${3:UClass}, ${4:ActorTransform}, ${5:Owner}, ${6:Instigator}, ESpawnActorCollisionHandlingMethod::${7|AlwaysSpawn,AdjustIfPossibleButAlwaysSpawn,AdjustIfPossibleButDontSpawnIfColliding,DontSpawnIfColliding|});",
"${8:/* INITIALIZATION */}",
"UGameplayStatics::FinishSpawningActor(${2:ActorName}, ${4:ActorTransform});"
],
"description": "Spawn Actor Deferred"
},
"Unreal SetTimer": {
"prefix": "utimer_set",
"body": "GetWorld()->GetTimerManager().SetTimer(${1:TimerHandle}, this, &${2:Class::Function}, ${3:DelayTime}, ${4:bLoop});",
"description": "Set a Timer/Delay"
},
"Unreal InvalidateTimer": {
"prefix": "utimer_invalidate",
"body": "${1:TimerHandle}.Invalidate();",
"description": "Invalidate a Timer Handle"
},
"Unreal ClearTimer": {
"prefix": "utimer_clear",
"body": "GetWorld()->GetTimerManager().ClearTimer(${1:TimerHandle});",
"description": "Clear a TimerHandle"
},
"Unreal InputAxis": {
"prefix": "ubindaxis",
"body": "InputComponent->BindAxis(\"${1:InputAxis}\", this, &${2:Class::Function});",
"description": "Bind an InputAxis"
},
"Unreal InputAction": {
"prefix": "ubindaction",
"body": "InputComponent->BindAction(\"${1:Button}\", IE_${2|Pressed,Released,Repeat,DoubleClick,Axis|}, this, &${3:Class::Function});",
"description": "Bind an InputAction"
},
"Unreal SpawnDecalLocation": {
"prefix": "uspawn_decal_location",
"body": "UDecalComponent* ${1:MyDecal} = UGameplayStatics::SpawnDecalAtLocation(GetWorld(), ${2:DecalMaterialInterface}, ${3:Size}, ${4:Location}, ${5:Rotation}, ${6:lifeSpan});",
"description": "Spawn Decal at Location"
},
"Unreal SpawnDecalAttached": {
"prefix": "uspawn_decal_attached",
"body": "UDecalComponent* ${1:MyDecal} = UGameplayStatics::SpawnDecalAttached(GetWorld(), ${2:DecalMaterialInterface}, ${3:Size}, ${4:AttachToComponent}, ${5:AttachPointName}, ${6:Location}, ${7:Rotation}, EAttachLocation::${8|KeepRelativeOffset,KeepWorldPosition,SnapToTarget,SnapToTargetIncludingScale|}, ${9:lifeSpan});",
"description": "Spawn Decal at Location"
},
"Unreal SpawnEmitterLocation": {
"prefix": ["uspawn_emitter_location", "uspawn_particles_location"],
"body": "UParticleSystemComponent* ${1:MyParticles} = UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ${2:ParticleSystem}, ${3:Location}, ${4:Rotation}, ${5:Scale}, ${6:bAutoDestroy});",
"description": "Spawn Particle System at Location"
},
"Unreal SpawnEmitterAttached": {
"prefix": ["uspawn_emitter_attached", "uspawn_particles_attached"],
"body": "UParticleSystemComponent* ${1:MyParticles} = UGameplayStatics::SpawnEmitterAttached(${2:ParticleSystem}, ${3:AttachToComponent}, ${4:AttachPointName}, ${5:Location}, ${6:Rotation}, ${7:Scale}, EAttachLocation::${8|KeepRelativeOffset,KeepWorldPosition,SnapToTarget,SnapToTargetIncludingScale|}, ${9:bAutoDestroy});",
"description": "Spawn Emitter Attached"
},
"Unreal SpawnDialog2D": {
"prefix": ["uspawn_dialog_2d", "uspawn_dialogue_2d"],
"body": "UAudioComponent* ${1:MyDialog} = UGameplayStatics::SpawnDialogue2D(GetWorld(), ${2:DialogWave}, ${3:DialogContext}, ${4:VolumeMultiplier}, ${5:PitchMultiplier}, ${6:StartTime}, ${7:bAutoDestroy});",
"description": "Spawn Dialog 2D"
},
"Unreal SpawnDialogLocation": {
"prefix": ["uspawn_dialog_location", "uspawn_dialogue_location"],
"body": "UAudioComponent* ${1:MyDialog} = UGameplayStatics::SpawnDialogueAtLocation(GetWorld(), ${2:DialogWave}, ${3:DialogContext}, ${4:Location}, ${5:Rotation}, ${6:VolumeMultiplier}, ${7:PitchMultiplier}, ${8:StartTime}, ${9:Attenuation}, ${10:bAutoDestroy});",
"description": "Spawn Dialog At Location"
},
"Unreal SpawnDialogAttached": {
"prefix": ["uspawn_dialog_attached", "uspawn_dialogue_attached"],
"body": "UAudioComponent* ${1:MyDialog} = UGameplayStatics::SpawnDialogueAttached(GetWorld(), ${2:DialogWave}, ${3:DialogContext}, ${4:AttachToComponent}, ${5:AttachPointName}, ${6:Location}, ${7:Rotation}, EAttachLocation::${8|KeepRelativeOffset,KeepWorldPosition,SnapToTarget,SnapToTargetIncludingScale|}, ${9:bStopWhenAttachedToDestroyed}, ${10:VolumeMultiplier}, ${11:PitchMultiplier}, ${12:StartTime}, ${13:Attenuation}, ${14:bAutoDestroy});",
"description": "Spawn Dialog Attached"
},
"Unreal SpawnSound2D": {
"prefix": "uspawn_sound_2d",
"body": "UAudioComponent* ${1:MySound} = UGameplayStatics::SpawnSound2D(GetWorld(), ${2:SoundBase}, ${3:VolumeMultiplier}, ${4:PitchMultiplier}, ${5:StartTime}, ${6:Concurrency}, ${7:bPersistentAcrossLevelTransition}, ${8:bAutoDestroy});",
"description": "Spawn Sound 2D"
},
"Unreal SpawnSoundLocation": {
"prefix": "uspawn_sound_location",
"body": "UAudioComponent* ${1:MySound} = UGameplayStatics::SpawnSoundAtLocation(GetWorld(), ${2:SoundBase}, ${3:Location}, ${4:Rotation}, ${5:VolumeMultiplier}, ${6:PitchMultiplier}, ${7:StartTime}, ${8:Attenuation}, ${9:Concurrency}, ${10:bAutoDestroy});",
"description": "Spawn Sound At Location"
},
"Unreal SpawnSoundAttached": {
"prefix": "uspawn_sound_attached",
"body": "UAudioComponent* ${1:MySound} = UGameplayStatics::SpawnSoundAttached(${2:SoundBase}, ${3:AttachToComponent}, ${4:AttachPointName}, ${5:Location}, ${6:Rotation}, EAttachLocation::${7|KeepRelativeOffset,KeepWorldPosition,SnapToTarget,SnapToTargetIncludingScale|}, ${8:bStopWhenAttachedToDestroyed}, ${9:VolumeMultipler}, ${10:PitchMultiplier}, ${11:StartTime}, ${12:Attenuation}, ${13:Concurrency}, ${14:bAutoDestroy});",
"description": "Spawn Sound Attached"
},
"Unreal PlayDialog2D": {
"prefix": ["uplay_dialog_2d", "uplay_dialogue_2d"],
"body": "UGameplayStatics::PlayDialogue2D(GetWorld(), ${1:DialogWave}, ${2:DialogContext}, ${3:VolumeMultiplier}, ${4:PitchMultiplier}, ${5:StartTime});",
"description": "Play Dialog 2D"
},
"Unreal PlayDialogLocation": {
"prefix": ["uplay_dialog_location", "uplay_dialogue_location"],
"body": "UGameplayStatics::PlayDialogueAtLocation(GetWorld(), ${1:DialogWave}, ${2:DialogContext}, ${3:Location}, ${4:Rotation}, ${5:VolumeMultiplier}, ${6:PitchMultiplier}, ${7:StartTime}, ${8:Attenuation});",
"description": "Play Dialog at Location"
},
"Unreal PlaySound2D": {
"prefix": "uplay_sound_2d",
"body": "UGameplayStatics::PlaySound2D(GetWorld(), ${1:SoundBase}, ${2:VolumeMultiplier}, ${3:PitchMultiplier}, ${4:StartTime}, ${5:Concurrency}, ${6:Owner});",
"description": "Play Sound 2D"
},
"Unreal PlaySoundLocation": {
"prefix": "uplay_sound_location",
"body": "UGameplayStatics::PlaySoundAtLocation(GetWorld(), ${1:SoundBase}, ${2:Location}, ${3:Rotation}, ${4:VolumeMultiplier}, ${5:PitchMultiplier}, ${6:StartTime}, ${7:Attenuation}, ${8:Concurrency}, ${9:Owner});",
"description": "Play Sound at Location"
},
"Unreal GetAllActorsOfClass": {
"prefix": "ugetallactorsofclass",
"body": "UGameplayStatics::GetAllActorsOfClass(GetWorld(), ${1:AClass}::StaticClass(), ${2:ActorArray});",
"description": "Get all Actors of one class from the level"
},
"Unreal FindRow": {
"prefix": "utable_findrow",
"body": "${1:FStruct}* ${2:MyStruct} = ${3:DataTable}->FindRow<${1:FStruct}>(\"${4:RowName}\", \"${5:ContextString}\", ${6:bWarnIfMissing});",
"description": "Get a row from a datatable, must use same struct as Table itself."
},
"Unreal Create SaveGame": {
"prefix": "usavegame_create",
"body": "${1:UMySaveGame}* ${2:Instance} = Cast<${1:UMySaveGame}>(UGameplayStatics::CreateSaveGameObject(${1:UMySaveGame}::StaticClass()));",
"description": "Create Instance of a SaveGame Class to save to or load from."
},
"Unreal Save SaveGame": {
"prefix": "usavegame_save",
"body": "UGameplayStatics::SaveGameToSlot(${1:Instance}, ${2:SaveSlotName}, ${3:UserIndex});",
"description": "Save a SaveGame Instance to disk."
},
"Unreal Load SaveGame": {
"prefix": "usavegame_load",
"body": "${1:UMySaveGame}* ${2:Instance} = Cast<${1:UMySaveGame}>(UGameplayStatics::LoadGameFromSlot(${3:SaveSlotName}, ${4:UserIndex}));",
"description": "Load a SaveGame from disk."
}
}

View File

@@ -0,0 +1,422 @@
{
"template": {
"prefix": "template",
"body": [
"<template>",
"\t<${1:div}$2>",
"\t\t$0",
"\t</${1:div}>",
"</template>"
],
"description": "template element"
},
"v-text": {
"prefix": "vText",
"body": [
"v-text=\"${1:msg}\""
],
"description": "Expects: string. Updates the elements textContent."
},
"v-html": {
"prefix": "vHtml",
"body": [
"v-html=\"${1:html}\""
],
"description": "Expects: string. Updates the elements innerHTML."
},
"v-show": {
"prefix": "vShow",
"body": [
"v-show=\"${1:condition}\""
],
"description": "Expects: any"
},
"v-if": {
"prefix": "vIf",
"body": [
"v-if=\"${1:condition}\""
],
"description": "Expects: any"
},
"v-else": {
"prefix": "vElse",
"body": [
"v-else"
],
"description": "Does not expect expression. previous sibling element must have v-if or v-else-if."
},
"v-else-if": {
"prefix": "vElseIf",
"body": [
"v-else-if=\"${1:condition}\""
],
"description": "Expects: any. previous sibling element must have v-if or v-else-if."
},
"v-for-without-key": {
"prefix": "vForWithoutKey",
"body": [
"v-for=\"${1:item} in ${2:items}\""
],
"description": "Expects: Array | Object | number | string"
},
"v-for": {
"prefix": "vFor",
"body": [
"v-for=\"(${1:item}, ${2:index}) in ${3:items}\" :key=\"${4:index}\""
],
"description": "Expects: Array | Object | number | string"
},
"v-on": {
"prefix": "vOn",
"body": [
"v-on:${1:event}=\"${2:handle}\""
],
"description": "Expects: Function | Inline Statement"
},
"v-on-shortcut": {
"prefix": "@",
"body": [
"@${1:event}=\"${2:handle}\""
],
"description": "v-on shortcut from vue 3"
},
"v-bind": {
"prefix": "vBind",
"body": [
"v-bind$1=\"${2}\""
],
"description": "Expects: any (with argument) | Object (without argument)"
},
"v-model": {
"prefix": "vModel",
"body": [
"v-model=\"${1:something}\""
],
"description": "Expects: varies based on value of form inputs element or output of components"
},
"v-slot": {
"prefix": "vSlot",
"body": [
"v-slot$1=\"${2}\""
],
"description": "Expects: JavaScript expression that is valid in a function argument position (supports destructuring in supported environments). Optional - only needed if expecting props to be passed to the slot."
},
"v-pre": {
"prefix": "vPre",
"body": [
"v-pre"
],
"description": "Does not expect expression"
},
"v-cloak": {
"prefix": "vCloak",
"body": [
"v-cloak"
],
"description": "Does not expect expression"
},
"v-once": {
"prefix": "vOnce",
"body": [
"v-once"
],
"description": "Does not expect expression"
},
"key": {
"prefix": "key",
"body": [
":key=\"${1:key}\""
],
"description": "Expects: string. Children of the same common parent must have unique keys. Duplicate keys will cause render errors."
},
"ref": {
"prefix": "ref",
"body": [
"ref=\"${1:reference}\"$0"
],
"description": "Expects: string. ref is used to register a reference to an element or a child component. The reference will be registered under the parent components $refs object. If used on a plain DOM element, the reference will be that element; if used on a child component, the reference will be component instance."
},
"slotA": {
"prefix": "slotA",
"body": [
"slot=\"$1\"$0"
],
"description": "slot=''. Expects: string. Used on content inserted into child components to indicate which named slot the content belongs to."
},
"slotE": {
"prefix": "slotE",
"body": [
"<slot$1>$2</slot>$0"
],
"description": "<slot></slot>. Expects: string. Used on content inserted into child components to indicate which named slot the content belongs to."
},
"slotScope": {
"prefix": "slotScope",
"body": [
"slot-scope=\"$1\"$0"
],
"description": "Used to denote an element or component as a scoped slot. The attributes value should be a valid JavaScript expression that can appear in the argument position of a function signature. This means in supported environments you can also use ES2015 destructuring in the expression. Serves as a replacement for scope in 2.5.0+."
},
"scope": {
"prefix": "scope",
"body": [
"scope=\"${1:this api replaced by slot-scope in 2.5.0+}\"$0"
],
"description": "Used to denote a <template> element as a scoped slot, which is replaced by `slot-scope` in 2.5.0+."
},
"component": {
"prefix": "component",
"body": [
"<component :is=\"${1:componentId}\"></component>$0"
],
"description": "component element"
},
"keep-alive": {
"prefix": "keepAlive",
"body": [
"<keep-alive$1>",
"$2",
"</keep-alive>$0"
],
"description": "keep-alive element"
},
"transition": {
"prefix": "transition",
"body": [
"<transition$1>",
"$2",
"</transition>$0"
],
"description": "transition element"
},
"transition-group": {
"prefix": "transitionGroup",
"body": [
"<transition-group$1>",
"$2",
"</transition-group>"
],
"description": "transition-group element"
},
"enter-class": {
"prefix": "enterClass",
"body": [
"enter-class=\"$1\"$0"
],
"description": "enter-class=''. Expects: string."
},
"leave-class": {
"prefix": "leaveClass",
"body": [
"leave-class=\"$1\"$0"
],
"description": "leave-class=''. Expects: string."
},
"appear-class": {
"prefix": "appearClass",
"body": [
"appear-class=\"$1\"$0"
],
"description": "appear-class=''. Expects: string."
},
"enter-to-class": {
"prefix": "enterToClass",
"body": [
"enter-to-class=\"$1\"$0"
],
"description": "enter-to-class=''. Expects: string."
},
"leave-to-class": {
"prefix": "leaveToClass",
"body": [
"leave-to-class=\"$1\"$0"
],
"description": "leave-to-class=''. Expects: string."
},
"appear-to-class": {
"prefix": "appearToClass",
"body": [
"appear-to-class=\"$1\"$0"
],
"description": "appear-to-class=''. Expects: string."
},
"enter-active-class": {
"prefix": "enterActiveClass",
"body": [
"enter-active-class=\"$1\"$0"
],
"description": "enter-active-class=''. Expects: string."
},
"leave-active-class": {
"prefix": "leaveActiveClass",
"body": [
"leave-active-class=\"$1\"$0"
],
"description": "leave-active-class=''. Expects: string."
},
"appear-active-class": {
"prefix": "appearActiveClass",
"body": [
"appear-active-class=\"$1\"$0"
],
"description": "appear-active-class=''. Expects: string."
},
"before-enter": {
"prefix": "beforeEnterEvent",
"body": [
"@before-enter=\"$1\"$0"
],
"description": "@before-enter=''"
},
"before-leave": {
"prefix": "beforeLeaveEvent",
"body": [
"@before-leave=\"$1\"$0"
],
"description": "@before-leave=''"
},
"before-appear": {
"prefix": "beforeAppearEvent",
"body": [
"@before-appear=\"$1\"$0"
],
"description": "@before-appear=''"
},
"enter": {
"prefix": "enterEvent",
"body": [
"@enter=\"$1\"$0"
],
"description": "@enter=''"
},
"leave": {
"prefix": "leaveEvent",
"body": [
"@leave=\"$1\"$0"
],
"description": "@leave=''"
},
"appear": {
"prefix": "appearEvent",
"body": [
"@appear=\"$1\"$0"
],
"description": "@appear=''"
},
"after-enter": {
"prefix": "afterEnterEvent",
"body": [
"@after-enter=\"$1\"$0"
],
"description": "@after-enter=''"
},
"after-leave": {
"prefix": "afterLeaveEvent",
"body": [
"@after-leave=\"$1\"$0"
],
"description": "@after-leave=''"
},
"after-appear": {
"prefix": "afterAppearEvent",
"body": [
"@after-appear=\"$1\"$0"
],
"description": "@after-appear=''"
},
"enter-cancelled": {
"prefix": "enterCancelledEvent",
"body": [
"@enter-cancelled=\"$1\"$0"
],
"description": "@enter-cancelled=''"
},
"leave-cancelled": {
"prefix": "leaveCancelledEvent",
"body": [
"@leave-cancelled=\"$1\"$0"
],
"description": "@leave-cancelled='' (v-show only)"
},
"appear-cancelled": {
"prefix": "appearCancelledEvent",
"body": [
"@appear-cancelled=\"$1\"$0"
],
"description": "@appear-cancelled=''"
},
"routerLink": {
"prefix": "routerLink",
"body": [
"<router-link $1>$2</router-link>$0"
],
"description": "router-link element"
},
"routerLinkTo": {
"prefix": "routerLinkTo",
"body": [
"<router-link to=\"$1\">$2</router-link>$0"
],
"description": "<router-link to=''></router-link>. router-link element"
},
"to": {
"prefix": "to",
"body": [
"to=\"$1\"$0"
],
"description": "to=''"
},
"tag": {
"prefix": "tag",
"body": [
"tag=\"$1\"$0"
],
"description": "tag=''"
},
"routerView": {
"prefix": "routerView",
"body": [
"<router-view>$1</router-view>$0"
],
"description": "router-view element"
},
"nuxt": {
"prefix": "nuxt",
"body": [
"<nuxt/>"
],
"description": "This component is used only in layouts to display the page components."
},
"nuxtChild": {
"prefix": "nuxtChild",
"body": [
"<nuxt-child $1/>$0"
],
"description": "This component is used for displaying the children components in a nested route."
},
"nuxtLink": {
"prefix": "nuxtLink",
"body": [
"<nuxt-link ${1|to,:to|}=\"$2\">$0</nuxt-link>"
],
"description": "This component is used to provide navigations between page components."
},
"teleport": {
"prefix": "teleport",
"body": [
"<Teleport to=\"$1\">",
"$0",
"</Teleport>"
],
"description": "<Teleport> is a built-in component that allows us to 'teleport' a part of a component's template into a DOM node that exists outside the DOM hierarchy of that component."
},
"suspense": {
"prefix": "suspense",
"body": [
"<Suspense>",
"$0",
"</Suspense>"
],
"description": "<Suspense> will render its default slot content in memory. If any async dependencies are encountered during the process, it will enter a pending state."
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,352 @@
{
"v-text": {
"prefix": "vText",
"body": [
"v-text='${1:msg}'"
],
"description": "Expects: string"
},
"v-html": {
"prefix": "vHtml",
"body": [
"v-html='${1:html}'"
],
"description": "Expects: string"
},
"v-show": {
"prefix": "vShow",
"body": [
"v-show='${1:condition}'"
],
"description": "Expects: any"
},
"v-if": {
"prefix": "vIf",
"body": [
"v-if='${1:condition}'"
],
"description": "Expects: any"
},
"v-else": {
"prefix": "vElse",
"body": [
"v-else"
],
"description": "Does not expect expression. previous sibling element must have v-if or v-else-if."
},
"v-else-if": {
"prefix": "vElseIf",
"body": [
"v-else-if='${1:condition}'"
],
"description": "Expects: any. previous sibling element must have v-if or v-else-if."
},
"v-for-without-key": {
"prefix": "vForWithoutKey",
"body": [
"v-for='${1:item} in ${2:items}'"
],
"description": "Expects: Array | Object | number | string"
},
"v-for": {
"prefix": "vFor",
"body": [
"v-for='${1:item} in ${2:items}' :key='${3:item.id}'"
],
"description": "Expects: Array | Object | number | string"
},
"v-on": {
"prefix": "vOn",
"body": [
"v-on:${1:event}='${2:handle}'"
],
"description": "Expects: Function | Inline Statement"
},
"v-bind": {
"prefix": "vBind",
"body": [
"v-bind$1='${2}'"
],
"description": "Expects: any (with argument) | Object (without argument)"
},
"v-model": {
"prefix": "vModel",
"body": [
"v-model='${1:something}'"
],
"description": "Expects: varies based on value of form inputs element or output of components"
},
"v-pre": {
"prefix": "vPre",
"body": [
"v-pre"
],
"description": "Does not expect expression"
},
"v-cloak": {
"prefix": "vCloak",
"body": [
"v-cloak"
],
"description": "Does not expect expression"
},
"v-once": {
"prefix": "vOnce",
"body": [
"v-once"
],
"description": "Does not expect expression"
},
"key": {
"prefix": "key",
"body": [
":key='${1:key}'"
],
"description": "Expects: string. Children of the same common parent must have unique keys. Duplicate keys will cause render errors."
},
"ref": {
"prefix": "ref",
"body": [
"ref='${1:reference}'$0"
],
"description": "Expects: string. ref is used to register a reference to an element or a child component. The reference will be registered under the parent components $refs object. If used on a plain DOM element, the reference will be that element; if used on a child component, the reference will be component instance."
},
"slotA": {
"prefix": "slotA",
"body": [
"slot='$1'$0"
],
"description": "slot=''. Expects: string. Used on content inserted into child components to indicate which named slot the content belongs to."
},
"slotE": {
"prefix": "slotE",
"body": [
"slot"
],
"description": "<slot></slot>. Expects: string. Used on content inserted into child components to indicate which named slot the content belongs to."
},
"slotScope": {
"prefix": "slotScope",
"body": [
"slot-scope='$1'$0"
],
"description": "Used to denote an element or component as a scoped slot. The attributes value should be a valid JavaScript expression that can appear in the argument position of a function signature. This means in supported environments you can also use ES2015 destructuring in the expression. Serves as a replacement for scope in 2.5.0+."
},
"scope": {
"prefix": "scope",
"body": [
"scope='${1:this api replaced by slot-scope in 2.5.0+}'$0"
],
"description": "Used to denote a <template> element as a scoped slot, which is replaced by `slot-scope` in 2.5.0+."
},
"component": {
"prefix": "component",
"body": [
"component(:is='${1:componentId}') $0"
],
"description": "component element"
},
"keep-alive": {
"prefix": "keepAlive",
"body": [
"keep-alive$0"
],
"description": "keep-alive element"
},
"transition": {
"prefix": "transition",
"body": [
"transition$0"
],
"description": "transition element"
},
"transition-group": {
"prefix": "transitionGroup",
"body": [
"transition-group$0"
],
"description": "transition-group element"
},
"enter-class": {
"prefix": "enterClass",
"body": [
"enter-class='$1'$0"
],
"description": "enter-class=''. Expects: string."
},
"leave-class": {
"prefix": "leaveClass",
"body": [
"leave-class='$1'$0"
],
"description": "leave-class=''. Expects: string."
},
"appear-class": {
"prefix": "appearClass",
"body": [
"appear-class='$1'$0"
],
"description": "appear-class=''. Expects: string."
},
"enter-to-class": {
"prefix": "enterToClass",
"body": [
"enter-to-class='$1'$0"
],
"description": "enter-to-class=''. Expects: string."
},
"leave-to-class": {
"prefix": "leaveToClass",
"body": [
"leave-to-class='$1'$0"
],
"description": "leave-to-class=''. Expects: string."
},
"appear-to-class": {
"prefix": "appearToClass",
"body": [
"appear-to-class='$1'$0"
],
"description": "appear-to-class=''. Expects: string."
},
"enter-active-class": {
"prefix": "enterActiveClass",
"body": [
"enter-active-class='$1'$0"
],
"description": "enter-active-class=''. Expects: string."
},
"leave-active-class": {
"prefix": "leaveActiveClass",
"body": [
"leave-active-class='$1'$0"
],
"description": "leave-active-class=''. Expects: string."
},
"appear-active-class": {
"prefix": "appearActiveClass",
"body": [
"appear-active-class='$1'$0"
],
"description": "appear-active-class=''. Expects: string."
},
"before-enter": {
"prefix": "beforeEnterEvent",
"body": [
"@before-enter='$1'$0"
],
"description": "@before-enter=''"
},
"before-leave": {
"prefix": "beforeLeaveEvent",
"body": [
"@before-leave='$1'$0"
],
"description": "@before-leave=''"
},
"before-appear": {
"prefix": "beforeAppearEvent",
"body": [
"@before-appear='$1'$0"
],
"description": "@before-appear=''"
},
"enter": {
"prefix": "enterEvent",
"body": [
"@enter='$1'$0"
],
"description": "@enter=''"
},
"leave": {
"prefix": "leaveEvent",
"body": [
"@leave='$1'$0"
],
"description": "@leave=''"
},
"appear": {
"prefix": "appearEvent",
"body": [
"@appear='$1'$0"
],
"description": "@appear=''"
},
"after-enter": {
"prefix": "afterEnterEvent",
"body": [
"@after-enter='$1'$0"
],
"description": "@after-enter=''"
},
"after-leave": {
"prefix": "afterLeaveEvent",
"body": [
"@after-leave='$1'$0"
],
"description": "@after-leave=''"
},
"after-appear": {
"prefix": "afterAppearEvent",
"body": [
"@after-appear='$1'$0"
],
"description": "@after-appear=''"
},
"enter-cancelled": {
"prefix": "enterCancelledEvent",
"body": [
"@enter-cancelled='$1'$0"
],
"description": "@enter-cancelled=''"
},
"leave-cancelled": {
"prefix": "leaveCancelledEvent",
"body": [
"@leave-cancelled='$1'$0"
],
"description": "@leave-cancelled='' (v-show only)"
},
"appear-cancelled": {
"prefix": "appearCancelledEvent",
"body": [
"@appear-cancelled='$1'$0"
],
"description": "@appear-cancelled=''"
},
"routerLink": {
"prefix": "routerLink",
"body": [
"router-link $0"
],
"description": "router-link element"
},
"routerLinkTo": {
"prefix": "routerLinkTo",
"body": [
"router-link(to='$1') $0"
],
"description": "router-link(to='') . router-link element"
},
"to": {
"prefix": "to",
"body": [
"to='$1'$0"
],
"description": "to=''"
},
"tag": {
"prefix": "tag",
"body": [
"tag='$1'$0"
],
"description": "tag=''"
},
"routerView": {
"prefix": "routerView",
"body": [
"router-view $0"
],
"description": "router-view element"
}
}

View File

@@ -0,0 +1,312 @@
{
"templateLang": {
"prefix": "templateLang",
"body": [
"<template lang=\"$1\">",
"\t<div$2>",
"\t\t$0",
"\t</div>",
"</template>"
],
"description": "template element"
},
"script": {
"prefix": "script",
"body": ["<script>", "export default {", "\t$0", "}", "</script>"],
"description": "script element"
},
"script-composition": {
"prefix": "scriptSetup",
"body": ["<script setup>", "\t$0", "</script>"],
"description": "script setup vue composition api element"
},
"script-ts-composition": {
"prefix": "scriptTsSetup",
"body": ["<script setup lang=\"ts\">", "\t$0", "</script>"],
"description": "script setup vue with lang ts composition api element"
},
"styleLang": {
"prefix": "styleLang",
"body": ["<style lang=\"$1\">", "\t$0", "</style>"],
"description": "style element with lang attribute"
},
"styleScoped": {
"prefix": "styleScoped",
"body": ["<style scoped>", "\t$0", "</style>"],
"description": "style scoped vue attribute"
},
"Vue Single File Component": {
"prefix": "vbase",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"\texport default {",
"\t\tname:\"$TM_FILENAME_BASE\",",
"\t\t${0}",
"\t}",
"</script>",
"",
"<style lang=\"scss\" scoped>",
"",
"</style>"
],
"description": "Base for Vue File with SCSS"
},
"Vue Single File Component with SASS": {
"prefix": "vbase-sass",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"\texport default {",
"\t\tname:\"$TM_FILENAME_BASE\",",
"\t\t${0}",
"\t}",
"</script>",
"",
"<style lang=\"sass\" scoped>",
"",
"</style>"
],
"description": "Base for Vue File with PostCSS"
},
"Vue Single File Component with LESS": {
"prefix": "vbase-less",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"\texport default {",
"\t\tname:\"$TM_FILENAME_BASE\",",
"\t\t${0}",
"\t}",
"</script>",
"",
"<style lang=\"less\" scoped>",
"",
"</style>"
],
"description": "Base for Vue File with PostCSS"
},
"Vue Single File Component with Css": {
"prefix": "vbase-css",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"\texport default {",
"\t\t${0}",
"\t}",
"</script>",
"",
"<style scoped>",
"",
"</style>"
],
"description": "Base for Vue File with CSS"
},
"Vue Single File Component with Typescript": {
"prefix": "vbase-ts",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script lang=\"ts\">",
"\timport Vue from 'vue'",
"",
"\texport default Vue.extend({",
"\t\tname:\"$TM_FILENAME_BASE\",",
"\t\t${0}",
"\t})",
"</script>",
"",
"<style scoped>",
"",
"</style>"
],
"description": "Base for Vue File with Typescript"
},
"Vue Single File Component with No Style": {
"prefix": "vbase-ns",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"\texport default {",
"\t\tname:\"$TM_FILENAME_BASE\",",
"\t\t${0}",
"\t}",
"</script>"
],
"description": "Base for Vue File with no styles"
},
"Vue Single File Component Composition API": {
"prefix": "vbase-3",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"export default {",
"\tsetup () {",
"\t\t${0}",
"",
"\t\treturn {}",
"\t}",
"}",
"</script>",
"",
"<style lang=\"scss\" scoped>",
"",
"</style>"
],
"description": "Base for Vue File Composition API with SCSS"
},
"Vue Single File Component Setup Composition API": {
"prefix": "vbase-3-setup",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script setup>",
"",
"</script>",
"",
"<style lang=\"scss\" scoped>",
"",
"</style>"
],
"description": "Base for Vue File Setup Composition API with SCSS"
},
"Vue Single File Component Composition API Reactive": {
"prefix": "vbase-3-reactive",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script>",
"import { reactive, toRefs } from 'vue'",
"",
"export default {",
"\tsetup () {",
"\t\tconst state = reactive({",
"\t\t\t${0:count}: ${1:0},",
"\t\t})",
"\t",
"\t\treturn {",
"\t\t\t...toRefs(state),",
"\t\t}",
"\t}",
"}",
"</script>",
"",
"<style lang=\"scss\" scoped>",
"",
"</style>"
],
"description": "Base for Vue File Composition API with SCSS"
},
"Vue Single File Component Composition API with Typescript": {
"prefix": "vbase-3-ts",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script lang=\"ts\">",
"import { defineComponent } from 'vue'",
"",
"export default defineComponent({",
"\tsetup () {",
"\t\t${0}\n",
"\t\treturn {}",
"\t}",
"})",
"</script>",
"",
"<style scoped>",
"",
"</style>"
],
"description": "Base for Vue File Composition API - Typescript"
},
"Vue Single File Component Setup Composition API with Typescript": {
"prefix": "vbase-3-ts-setup",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script setup lang=\"ts\">",
"",
"</script>",
"",
"<style scoped>",
"",
"</style>"
],
"description": "Base for Vue File Setup Composition API - Typescript"
},
"Vue Single File Component with Class based Typescript format": {
"prefix": "vbase-ts-class",
"body": [
"<template>",
"\t<div>",
"",
"\t</div>",
"</template>",
"",
"<script lang=\"ts\">",
"\timport { Component, Vue } from 'vue-property-decorator';",
"",
"\t@Component",
"\texport default class $TM_FILENAME_BASE extends Vue {",
"\t\t",
"\t}",
"</script>",
"",
"<style scoped>",
"",
"</style>"
],
"description": "Base for Vue File with Class based Typescript format"
}
}