.
This commit is contained in:
1 parent
cff80541c9
commit
f8b9becdb8
98 files changed
-15609
No files matched your search
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"Django URLFile Template":{
|
||||
"prefix": "fturl",
|
||||
"body": [
|
||||
"from django.urls import path",
|
||||
"from . import views as v",
|
||||
"\n\napp_name = ${1:AppName}",
|
||||
"urlpatterns = [",
|
||||
"\t# TODO: Define $1 URLs here",
|
||||
"\t${0}",
|
||||
"]"
|
||||
],
|
||||
"description": "Django File-Template Sinppet For ``URL`` File"
|
||||
},
|
||||
"Django FormFile Template":{
|
||||
"prefix": "ftform",
|
||||
"body": [
|
||||
"from django import forms",
|
||||
"from ${1:.models} import ${2}",
|
||||
"\n\n# TODO: Create your forms here",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Django File-Template Sinppet For ``Form`` File"
|
||||
},
|
||||
"Django CustomTagsFile Template":{
|
||||
"prefix": "ftcutomtags",
|
||||
"body": [
|
||||
"from django import template",
|
||||
"\nregister = template.Library()",
|
||||
"\n# TODO: Create your custom tags here",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Django File-Template Sinppet For ``CustomTags`` File"
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
{
|
||||
"Django Simple Form ":{
|
||||
"prefix": "sform",
|
||||
"body": [
|
||||
"class ${1:Name}Form(forms.Form):",
|
||||
"\t# Define $1Form fields here",
|
||||
"\t${0}"
|
||||
],
|
||||
"description": "Django Simple Form"
|
||||
},
|
||||
"Django Model Form ":{
|
||||
"prefix": "modelform",
|
||||
"body": [
|
||||
"class ${1:ModelName}Form(forms.ModelForm):",
|
||||
"\tclass Meta:",
|
||||
"\t\tmodel = ${2:$1}",
|
||||
"\t\tfields = (${3:\"__all__\"})",
|
||||
"\t\t${0}"
|
||||
],
|
||||
"description": "Django Model Form"
|
||||
},
|
||||
"Forms BooleanField":{
|
||||
"prefix": "fbool",
|
||||
"body": "${1:FIELDNAME} = forms.BooleanField(${2})",
|
||||
"description": "Django forms ``BooleanField``"
|
||||
},
|
||||
"Forms CharField":{
|
||||
"prefix": "fchar",
|
||||
"body": "${1:FIELDNAME} = forms.CharField(${2})",
|
||||
"description": "Django forms ``CharField``"
|
||||
},
|
||||
"Forms ComboField":{
|
||||
"prefix": "fcombo",
|
||||
"body": "${1:FIELDNAME} = forms.ComboField(${2})",
|
||||
"description": "Django forms ``ComboField``"
|
||||
},
|
||||
"Forms DateField":{
|
||||
"prefix": "fdate",
|
||||
"body": "${1:FIELDNAME} = forms.DateField(${2})",
|
||||
"description": "Django forms ``DateField``"
|
||||
},
|
||||
"Forms DateTime":{
|
||||
"prefix": "fdatetime",
|
||||
"body": "${1:FIELDNAME} = forms.DateTime(${2})",
|
||||
"description": "Django forms ``DateTime``"
|
||||
},
|
||||
"Forms DecimalField":{
|
||||
"prefix": "fdecimal",
|
||||
"body": "${1:FIELDNAME} = forms.DecimalField(${2})",
|
||||
"description": "Django forms ``DecimalField``"
|
||||
},
|
||||
"Forms DurationField":{
|
||||
"prefix": "fduration",
|
||||
"body": "${1:FIELDNAME} = forms.DurationField(${2})",
|
||||
"description": "Django forms ``DurationField``"
|
||||
},
|
||||
"Forms EmailField":{
|
||||
"prefix": "femail",
|
||||
"body": "${1:FIELDNAME} = forms.EmailField(${2})",
|
||||
"description": "Django forms ``EmailField``"
|
||||
},
|
||||
"Forms FileField":{
|
||||
"prefix": "ffile",
|
||||
"body": "${1:FIELDNAME} = forms.FileField(${2})",
|
||||
"description": "Django forms ``FileField``"
|
||||
},
|
||||
"Forms FilePathField":{
|
||||
"prefix": "ffilepath",
|
||||
"body": "${1:FIELDNAME} = forms.FilePathField(${2})",
|
||||
"description": "Django forms ``FilePathField``"
|
||||
},
|
||||
"Forms FloatField":{
|
||||
"prefix": "ffloat",
|
||||
"body": "${1:FIELDNAME} = forms.FloatField(${2})",
|
||||
"description": "Django forms ``FloatField``"
|
||||
},
|
||||
"Forms GenericIPAddressField":{
|
||||
"prefix": "fgip",
|
||||
"body": "${1:FIELDNAME} = forms.GenericIPAddressField(${2})",
|
||||
"description": "Django forms ``GenericIPAddressField``"
|
||||
},
|
||||
"Forms GenericIPAddressField":{
|
||||
"prefix": "fgip",
|
||||
"body": "${1:FIELDNAME} = forms.GenericIPAddressField(${2})",
|
||||
"description": "Django forms ``GenericIPAddressField``"
|
||||
},
|
||||
"Forms ImageField":{
|
||||
"prefix": "fimg",
|
||||
"body": "${1:FIELDNAME} = forms.ImageField(${2})",
|
||||
"description": "Django forms ``ImageField``"
|
||||
},
|
||||
"Forms IntegerField":{
|
||||
"prefix": "fint",
|
||||
"body": "${1:FIELDNAME} = forms.IntegerField(${2})",
|
||||
"description": "Django forms ``IntegerField``"
|
||||
},
|
||||
"Forms IPAddressField":{
|
||||
"prefix": "fip",
|
||||
"body": "${1:FIELDNAME} = forms.IPAddressField(${2})",
|
||||
"description": "Django forms ``IPAddressField``"
|
||||
},
|
||||
"Forms ModelChoiceField":{
|
||||
"prefix": "fmochoice",
|
||||
"body": "${1:FIELDNAME} = forms.ModelChoiceField(${2})",
|
||||
"description": "Django forms ``ModelChoiceField``"
|
||||
},
|
||||
"Forms ModelMultipleChoiceField":{
|
||||
"prefix": "fmomuchoice",
|
||||
"body": "${1:FIELDNAME} = forms.ModelMultipleChoiceField(${2})",
|
||||
"description": "Django forms ``ModelMultipleChoiceField``"
|
||||
},
|
||||
"Forms MultipleChoiceField":{
|
||||
"prefix": "fmuchoice",
|
||||
"body": "${1:FIELDNAME} = forms.MultipleChoiceField(${2})",
|
||||
"description": "Django forms ``MultipleChoiceField``"
|
||||
},
|
||||
"Forms MultipleValueField":{
|
||||
"prefix": "fmuvalue",
|
||||
"body": "${1:FIELDNAME} = forms.MultipleValueField(${2})",
|
||||
"description": "Django forms ``MultipleValueField``"
|
||||
},
|
||||
"Forms NullBooleanField":{
|
||||
"prefix": "fnullbool",
|
||||
"body": "${1:FIELDNAME} = forms.NullBooleanField(${2})",
|
||||
"description": "Django forms ``NullBooleanField``"
|
||||
},
|
||||
"Forms RegexField":{
|
||||
"prefix": "fregex",
|
||||
"body": "${1:FIELDNAME} = forms.RegexField(${2})",
|
||||
"description": "Django forms ``RegexField``"
|
||||
},
|
||||
"Forms SlugField":{
|
||||
"prefix": "fslug",
|
||||
"body": "${1:FIELDNAME} = forms.SlugField(${2})",
|
||||
"description": "Django forms ``SlugField``"
|
||||
},
|
||||
"Forms SplitDateTime":{
|
||||
"prefix": "fsdatetime",
|
||||
"body": "${1:FIELDNAME} = forms.SplitDateTime(${2})",
|
||||
"description": "Django forms ``SplitDateTime`` Field"
|
||||
},
|
||||
"Forms TimeField":{
|
||||
"prefix": "ftime",
|
||||
"body": "${1:FIELDNAME} = forms.TimeField(${2})",
|
||||
"description": "Django forms ``TimeField``"
|
||||
},
|
||||
"Forms TypedChoiceField":{
|
||||
"prefix": "ftchoice",
|
||||
"body": "${1:FIELDNAME} = forms.TypedChoiceField(${2})",
|
||||
"description": "Django forms ``TypedChoiceField``"
|
||||
},
|
||||
"Forms TypedMultipleChoiceField":{
|
||||
"prefix": "ftmuchoice",
|
||||
"body": "${1:FIELDNAME} = forms.TypedMultipleChoiceField(${2})",
|
||||
"description": "Django forms ``TypedMultipleChoiceField``"
|
||||
},
|
||||
"Forms URLField":{
|
||||
"prefix": "fulr",
|
||||
"body": "${1:FIELDNAME} = forms.URLField(${2})",
|
||||
"description": "Django forms ``URLField``"
|
||||
},
|
||||
"Forms UUIDField":{
|
||||
"prefix": "fuuid",
|
||||
"body": "${1:FIELDNAME} = forms.UUIDField(${2})",
|
||||
"description": "Django forms ``UUIDField``"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"Import forms":{
|
||||
"prefix": "di-forms",
|
||||
"body": "from django import forms",
|
||||
"description": "Import Django ``forms``"
|
||||
},
|
||||
"Import models":{
|
||||
"prefix": "di-model",
|
||||
"body": "from django import models",
|
||||
"description": "Import Django ``models``"
|
||||
},
|
||||
"Import get_user_model":{
|
||||
"prefix": "di-getusermodel",
|
||||
"body": "from django.contrib.auth import get_user_model",
|
||||
"description": "Import Django ``get_user_model``"
|
||||
},
|
||||
"Import generic views":{
|
||||
"prefix": "di-generic",
|
||||
"body": "from django.views import generic",
|
||||
"description": "Import Django ``generic``"
|
||||
},
|
||||
"Import JsonResponse":{
|
||||
"prefix": "di-jsonresponse",
|
||||
"body": "from django.http import JsonResponse",
|
||||
"description": "Import Django ``JsonResponse``"
|
||||
},
|
||||
"Import reverse":{
|
||||
"prefix": "di-reverse",
|
||||
"body": "from django.urls import reverse",
|
||||
"description": "Import Django ``reverse``"
|
||||
},
|
||||
"Import reverse_lazy":{
|
||||
"prefix": "di-reverse_lazy",
|
||||
"body": "from django.urls import revers_lazy",
|
||||
"description": "Import Django ``revers_lazy``"
|
||||
},
|
||||
|
||||
"Import messages":{
|
||||
"prefix": "di-messages",
|
||||
"body": "from django.contrib import messages",
|
||||
"description": "Import Django ``messages``"
|
||||
}
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
{
|
||||
"Django Simple Model": {
|
||||
"prefix": "smodel",
|
||||
"body": [
|
||||
"class ${1:ModelName}(models.Model):",
|
||||
"\t# Define $1 fields here",
|
||||
"\t${2}",
|
||||
"\n\tclass Meta:",
|
||||
"\t\tordering = [\"${3:-pk}\"]",
|
||||
"\t\tverbose_name = \"${4:$1}\"",
|
||||
"\t\tverbose_name_plural = \"${5:$1s}\"",
|
||||
"\n\tdef __str__(self):",
|
||||
"\t\treturn ${6:super().__str__()}",
|
||||
"\n\t# Define $1 properties here",
|
||||
"\t${0}"
|
||||
],
|
||||
"description": "Django Simple Model with properties and attributes"
|
||||
},
|
||||
"Django Full Model": {
|
||||
"prefix": "model",
|
||||
"body": [
|
||||
"class ${1:ModelName}(models.Model):",
|
||||
"\t# Define $1 fields here",
|
||||
"\t${2}",
|
||||
"\n\tclass Meta:",
|
||||
"\t\tordering = [\"${3:-pk}\"]",
|
||||
"\t\tverbose_name = \"${4:$1}\"",
|
||||
"\t\tverbose_name_plural = \"${5:$1s}\"",
|
||||
"\n\tdef __str__(self):",
|
||||
"\t\treturn ${6:super().__str__()}",
|
||||
"\n\tdef save(self, *args, **kwargs):",
|
||||
"\t\treturn ${7:super().save(*args, **kwargs)}",
|
||||
"\n\tdef get_absolute_url(self):",
|
||||
"\t\treturn reverse('${8:view_or_url_name}', kwargs={${9:'pk'}: ${10: self.pk}})",
|
||||
"\n\t# Define $1 properties here",
|
||||
"\t${0}"
|
||||
],
|
||||
"description": "Django Full Model with properties and attributes"
|
||||
},
|
||||
|
||||
"Models AutoField":{
|
||||
"prefix": "mauto",
|
||||
"body": "${1:FIELDNAME} = models.AutoField(${2})",
|
||||
"description": "Django model ``AutoField``"
|
||||
},
|
||||
"Models BigIntegerField":{
|
||||
"prefix": "mbigint",
|
||||
"body": "${1:FIELDNAME} = models.AutoField(${2})",
|
||||
"description": "Django model ``AutoField``"
|
||||
},
|
||||
"Models BinaryField":{
|
||||
"prefix": "mbinary",
|
||||
"body": "${1:FIELDNAME} = models.BinaryField(${2})",
|
||||
"description": "Django model ``BinaryField``"
|
||||
},
|
||||
"Models Boolean":{
|
||||
"prefix": "mbool",
|
||||
"body": "${1:FIELDNAME} = models.BooleanField(default=${2:False})",
|
||||
"description": "Django model ``BooleanField``"
|
||||
},
|
||||
"Models CharField":{
|
||||
"prefix": "mchar",
|
||||
"body": "${1:FieldName} = models.CharField(max_length=${2:32})",
|
||||
"description": "Django model ``CharField``"
|
||||
},
|
||||
"Models CommaSeparatedIntegerField":{
|
||||
"prefix": "mcomma",
|
||||
"body": "${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2})",
|
||||
"description": "Django model ``CommaSeparatedIntegerField``"
|
||||
},
|
||||
"Models DateField":{
|
||||
"prefix": "mdate",
|
||||
"body": "${1:FIELDNAME} = models.DateField(auto_now_add=${2:True}, auto_now=${3:False}})",
|
||||
"description": "Django model ``DateField``"
|
||||
},
|
||||
"Models DateTimeField":{
|
||||
"prefix": "mdatetime",
|
||||
"body": "${1:FIELDNAME} = models.DateTimeField(auto_now_add=${2:True}, auto_now=${3:False})",
|
||||
"description": "Django model ``DateTimeField``"
|
||||
},
|
||||
"Models DecimalField":{
|
||||
"prefix": "mdecimal",
|
||||
"body": "${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${3})",
|
||||
"description": "Django model ``DecimalField``"
|
||||
},
|
||||
"Models EmailField":{
|
||||
"prefix": "memail",
|
||||
"body": "${1:FIELDNAME} = models.EmailField(${2})",
|
||||
"description": "Django model ``EmailField``"
|
||||
},
|
||||
"Models FileField":{
|
||||
"prefix": "mfile",
|
||||
"body": "${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload})",
|
||||
"description": "Django model ``FileField``"
|
||||
},
|
||||
"Models FilePathField":{
|
||||
"prefix": "mfilepath",
|
||||
"body": "${1:FIELDNAME} = models.FilePathField(path=${2:\"/abs/path/to/dir\"}${3:, max_length=100}${4:, match=\"*.ext\"}${4:, recursive=True})",
|
||||
"description": "Django model ``FilePathField``"
|
||||
},
|
||||
"Models FloatField":{
|
||||
"prefix": "mfloat",
|
||||
"body": "${1:FIELDNAME} = models.FloatField(${2})",
|
||||
"description": "Django model ``FloatField``"
|
||||
},
|
||||
"Models ImageField":{
|
||||
"prefix": "mimg",
|
||||
"body": "${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100})",
|
||||
"description": "Django model ``ImageField``"
|
||||
},
|
||||
"Models IntegerField":{
|
||||
"prefix": "mint",
|
||||
"body": "${1:FIELDNAME} = models.IntegerField(${2})",
|
||||
"description": "Django model ``IntegerField``"
|
||||
},
|
||||
"Models IPAddressField":{
|
||||
"prefix": "mip",
|
||||
"body": "${1:FIELDNAME} = models.IPAddressField(${2})",
|
||||
"description": "Django model ``IPAddressField``"
|
||||
},
|
||||
"Models NullBooleanField":{
|
||||
"prefix": "mnullboolean",
|
||||
"body": "${1:FIELDNAME} = models.NullBooleanField(${2})",
|
||||
"description": "Django model ``NullBooleanField``"
|
||||
},
|
||||
"Models PositiveIntegerField":{
|
||||
"prefix": "mposint",
|
||||
"body": "${1:FIELDNAME} = models.PositiveIntegerField(${2})",
|
||||
"description": "Django model ``PositiveIntegerField``"
|
||||
},
|
||||
"Models PositiveSmallIntegerField":{
|
||||
"prefix": "mpossmallint",
|
||||
"body": "${1:FIELDNAME} = models.PositiveSmallIntegerField(${2})",
|
||||
"description": "Django model ``PositiveSmallIntegerField``"
|
||||
},
|
||||
"Models SlugField":{
|
||||
"prefix": "mslug",
|
||||
"body": "${1:FIELDNAME} = models.SlugField(${2})",
|
||||
"description": "Django model ``SlugField``"
|
||||
},
|
||||
"Models SmallIntegerField":{
|
||||
"prefix": "msmallint",
|
||||
"body": "${1:FIELDNAME} = models.SmallIntegerField(${2})",
|
||||
"description": "Django model ``SmallIntegerField``"
|
||||
},
|
||||
"Models TextField":{
|
||||
"prefix": "mtext",
|
||||
"body": "${1:FIELDNAME} = models.TextField(${2})",
|
||||
"description": "Django model ``TextField``"
|
||||
},
|
||||
"Models TimeField":{
|
||||
"prefix": "mtime",
|
||||
"body": "${1:FIELDNAME} = models.TimeField(auto_now_add=${2:True}, auto_now=${3:False})",
|
||||
"description": "Django model ``TimeField``"
|
||||
},
|
||||
"Models URLField":{
|
||||
"prefix": "murl",
|
||||
"body": "${1:FIELDNAME} = models.URLField(verify_exists=${2:False})",
|
||||
"description": "Django model ``URLField``"
|
||||
},
|
||||
"Models XMLField":{
|
||||
"prefix": "mxml",
|
||||
"body": "${1:FIELDNAME} = models.XMLField(schema_path=${2:None})",
|
||||
"description": "Django model ``XMLField``"
|
||||
},
|
||||
|
||||
"Models ForeignKey":{
|
||||
"prefix": "fk",
|
||||
"body": "${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}, on_delete=models.${3:CASCADE}, related_name=\"${4:RelatedName}\" ${0:, limit_choices_to=})",
|
||||
"description": "Django model ``ForeignKey``"
|
||||
},
|
||||
"Models ManyToManyField":{
|
||||
"prefix": "m2m",
|
||||
"body": "${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}, related_name=\"${3:RelatedName}\" ${0:, limit_choices_to=})",
|
||||
"description": "Django model ``ManyToManyField``"
|
||||
},
|
||||
"Models OneToOneField":{
|
||||
"prefix": "o2o",
|
||||
"body": "${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}, related_name=\"${4:RelatedName}\"${0:, to_field=''})",
|
||||
"description": "Django model ``OneToOneField``"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
{
|
||||
"Django CreateView":{
|
||||
"prefix": "createview",
|
||||
"body": [
|
||||
"class ${1:ModelName}CreateView(generic.CreateView):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\ttemplate_name = \"${3:$1/$1_form.html}\"",
|
||||
"\tform_class = ${4:forms.$1Form}",
|
||||
"\tsuccess_url = \"${5:.}\""
|
||||
],
|
||||
"description": "Django CBV ``CreateView``"
|
||||
},
|
||||
"Django UpdateView":{
|
||||
"prefix": "updateview",
|
||||
"body": [
|
||||
"class ${1:ModelName}UpdateView(generic.UpdateView):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\ttemplate_name = \"${3:$1/$1_form.html}\"",
|
||||
"\tform_class = ${4:forms.$1Form}",
|
||||
"\tsuccess_url = \"${5:.}\"",
|
||||
"\n\tdef get_object(self):",
|
||||
"\t\treturn $1.objects.get(pk=${6:self.kwargs.get(\"pk\")})"
|
||||
],
|
||||
"description": "Django CBV ``UpdateView``"
|
||||
},
|
||||
"Django DeleteView":{
|
||||
"prefix": "deleteview",
|
||||
"body": [
|
||||
"class ${1:ModelName}DeleteView(generic.DeleteView):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\n\tdef get_success_url(self):",
|
||||
"\t\treturn reverse(\"${3:$1:list}\")",
|
||||
"\n\tdef get(self, request, *args, **kwargs):",
|
||||
"\t\treturn post(request, *args, **kwargs)"
|
||||
],
|
||||
"description": "Django CBV ``DeleteView``"
|
||||
},
|
||||
"Django DetailView":{
|
||||
"prefix": "detailview",
|
||||
"body": [
|
||||
"class ${1:ModelName}DetailView(generic.DetailView):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\ttemplate_name = \"${3:$1/$1_detail.html}\"",
|
||||
"\n\tdef get_object(self):",
|
||||
"\t\treturn $1.objects.get(pk=${4:self.kwargs.get(\"pk\")})",
|
||||
"\n\tdef get_queryset(self):",
|
||||
"\t\treturn $1.objects.filter(${5})"
|
||||
],
|
||||
"description": "Django CBV ``DetailView``"
|
||||
},
|
||||
"Django ListView":{
|
||||
"prefix": "listview",
|
||||
"body": [
|
||||
"class ${1:ModelName}ListView(generic.ListView):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\ttemplate_name = \"${3:$1/$1_list.html}\"",
|
||||
"\n\tdef get_queryset(self):",
|
||||
"\t\treturn $1.objects.filter(${4})"
|
||||
],
|
||||
"description": "Django CBV ``ListView``"
|
||||
},
|
||||
"Django TemplateView":{
|
||||
"prefix": "templateview",
|
||||
"body": [
|
||||
"class ${1:ModelName}TemplateView(generic.TemplateView):",
|
||||
"\ttemplate_name = \"${2:$1/$1_list.html}\"",
|
||||
"\n${3}"
|
||||
],
|
||||
"description": "Django CBV ``TemplateView``"
|
||||
},
|
||||
"Django FormView":{
|
||||
"prefix": "formview",
|
||||
"body": [
|
||||
"class ${1:ModelName}FormView(generic.FormView):",
|
||||
"\tform_class = ${2:forms.$1Form}",
|
||||
"\ttemplate_name = \"${3}\""
|
||||
],
|
||||
"description": "Django CBV ``FormView``"
|
||||
},
|
||||
"Django AdminView":{
|
||||
"prefix": "adminview",
|
||||
"body": [
|
||||
"@admin.register($1)",
|
||||
"class ${1:ModelName}Admin(admin.ModelAdmin):",
|
||||
"\tlist_display = ${2:\"pk\",}",
|
||||
"\tsearch_fields = ${3:\"pk\",}",
|
||||
"\tlist_filter = ${4:\"FilterFields\",}"
|
||||
],
|
||||
"description": "Django AdminView for ``admin.py``"
|
||||
},
|
||||
"Django AdminTabularInline":{
|
||||
"prefix": "tabularinline",
|
||||
"body": [
|
||||
"class ${1:ModelName}Inline(admin.TabularInline):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\tmin_num = ${4:0}",
|
||||
"\tmax_num = ${4:8}",
|
||||
"\textra = ${5:1}"
|
||||
],
|
||||
"description": "Django TabularInline for ``admin.py``"
|
||||
},
|
||||
"Django AdminStackedInline":{
|
||||
"prefix": "stackedinline",
|
||||
"body": [
|
||||
"class ${1:ModelName}Inline(admin.StackedInline):",
|
||||
"\tmodel = ${2:$1}",
|
||||
"\tmin_num = ${4:0}",
|
||||
"\tmax_num = ${4:8}",
|
||||
"\textra = ${5:1}"
|
||||
],
|
||||
"description": "Django StackedInline for ``admin.py``"
|
||||
},
|
||||
|
||||
"Django Views get_context_data":{
|
||||
"prefix": "getcontextdata",
|
||||
"body": [
|
||||
"def get_context_data(self, *args, **kwargs):",
|
||||
"\tcontext = super().get_context_data(*args, **kwargs)",
|
||||
"\treturn context"
|
||||
],
|
||||
"description": "Django Views ``get_context_data`` method"
|
||||
},
|
||||
"Django Views get_success_url":{
|
||||
"prefix": "getsuccessurl",
|
||||
"body": [
|
||||
"def get_success_url(self):",
|
||||
"\treturn reverse(\"${1:ViewName}\", kwargs={${2:\"pk\": self.get_object().pk}})"
|
||||
],
|
||||
"description": "Django Views ``get_success_url`` method"
|
||||
},
|
||||
"Django Views get_queryset":{
|
||||
"prefix": "getqueryset",
|
||||
"body": [
|
||||
"def get_queryset(self):",
|
||||
"\treturn ${1:ModelName}.objects.filter(${2})"
|
||||
],
|
||||
"description": "Django Views ``get_queryset`` method"
|
||||
},
|
||||
"Django Views get_object":{
|
||||
"prefix": "getobject",
|
||||
"body": [
|
||||
"def get_object(self):",
|
||||
"\treturn ${1:ModelName}.objects.get(${2})"
|
||||
],
|
||||
"description": "Django Views ``get_object`` method"
|
||||
},
|
||||
"Django Views form_valid":{
|
||||
"prefix": "formvalid",
|
||||
"body": [
|
||||
"def form_valid(self, form):",
|
||||
"\treturn super().form_valid(form)"
|
||||
],
|
||||
"description": "Django Views ``form_valid`` method"
|
||||
},
|
||||
"Django Views form_invalid":{
|
||||
"prefix": "forminvalid",
|
||||
"body": [
|
||||
"def form_invalid(self, form):",
|
||||
"\treturn super().form_invalid(form)"
|
||||
],
|
||||
"description": "Django Views ``form_invalid`` method"
|
||||
},
|
||||
"Django Views get_form_kwargs":{
|
||||
"prefix": "getformkwargs",
|
||||
"body": [
|
||||
"def get_form_kwargs(self, form):",
|
||||
"\tkwargs = super().get_form_kwargs()",
|
||||
"\treturn kwargs"
|
||||
],
|
||||
"description": "Django Views ``get_form_kwargs`` method"
|
||||
},
|
||||
"Django Views dispatch":{
|
||||
"prefix": "dispatch",
|
||||
"body": [
|
||||
"def dispatch(self, request, *args, **kwargs):",
|
||||
"\treturn super().dispatch(request, *args, **kwargs)"
|
||||
],
|
||||
"description": "Django Views ``dispatch`` method"
|
||||
},
|
||||
"Django Views get_initial":{
|
||||
"prefix": "getinitial",
|
||||
"body": [
|
||||
"def get_initial(self):",
|
||||
"\tinit = super().get_initial()",
|
||||
"\treturn init"
|
||||
],
|
||||
"description": "Django Views ``get_initial`` method"
|
||||
},
|
||||
"Django Views post":{
|
||||
"prefix": "post",
|
||||
"body": [
|
||||
"def post(self, request, *args, **kwargs):",
|
||||
"\treturn super().post(request, *args, **kwargs)"
|
||||
],
|
||||
"description": "Django Views ``post`` method"
|
||||
},
|
||||
"Django Views get":{
|
||||
"prefix": "get",
|
||||
"body": [
|
||||
"def get(self, request, *args, **kwargs):",
|
||||
"\treturn super().get(request, *args, **kwargs)"
|
||||
],
|
||||
"description": "Django Views ``post`` method"
|
||||
},
|
||||
|
||||
|
||||
"Django Forms field_clean":{
|
||||
"prefix": "cleanf",
|
||||
"body": [
|
||||
"def clean_${1:FieldName}(self):",
|
||||
"\t$1 = self.cleaned_data[\"$1\"]",
|
||||
"\t${0}",
|
||||
"\treturn $1"
|
||||
],
|
||||
"description": "Django Views ``field_clean`` method"
|
||||
},
|
||||
"Django Forms clean":{
|
||||
"prefix": "cleanff",
|
||||
"body": [
|
||||
"def clean(self):",
|
||||
"\tcleaned_data = super().clean()",
|
||||
"\t${0}"
|
||||
],
|
||||
"description": "Django Views ``clean`` method"
|
||||
},
|
||||
|
||||
|
||||
"Django FBV Path":{
|
||||
"prefix": "fpath",
|
||||
"body": "path(\"${1:Path}\", v.${2:View}, name=${0:PathName})",
|
||||
"description": "Django Path For ``Function Based Views``"
|
||||
},
|
||||
"Django CBV Path":{
|
||||
"prefix": "cpath",
|
||||
"body": "path(\"${1:Path}\", v.${2:View}.as_viewJ(), name=${0:PathName})",
|
||||
"description": "Django Path For ``Class Based Views``"
|
||||
},
|
||||
"Django Path as Include":{
|
||||
"prefix": "ipath",
|
||||
"body": "path(\"${1:Path}\", include(\"${2}.urls\", namespace=${0:Name})",
|
||||
"description": "Django Path as ``Include``"
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,498 +0,0 @@
|
||||
{
|
||||
"Stateless Widget": {
|
||||
"prefix": "statelessW",
|
||||
"body": [
|
||||
"class ${1:name} extends StatelessWidget {",
|
||||
" const ${1:name}({Key? key}) : super(key: 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}({Key? key}) : super(key: key);\n",
|
||||
" @override",
|
||||
" _${1:WidgetName}State 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"
|
||||
}
|
||||
}
|
||||
@@ -1,526 +0,0 @@
|
||||
{
|
||||
"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}",
|
||||
"---"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,294 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,536 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,397 +0,0 @@
|
||||
{
|
||||
"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 element’s textContent."
|
||||
},
|
||||
"v-html": {
|
||||
"prefix": "vHtml",
|
||||
"body": [
|
||||
"v-html=\"${1:html}\""
|
||||
],
|
||||
"description": "Expects: string. Updates the element’s 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-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 component’s $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 attribute’s 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."
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,352 +0,0 @@
|
||||
{
|
||||
"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 component’s $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 attribute’s 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"
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"styleLang": {
|
||||
"prefix": "styleLang",
|
||||
"body": [
|
||||
"<style lang=\"$1\">",
|
||||
"\t$0",
|
||||
"</style>"
|
||||
],
|
||||
"description": "style element with lang attribute"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user