From 2e7adeeec7db4558e01ef78a3a757f6c4eed4c7d Mon Sep 17 00:00:00 2001 From: Anil Chaudhari Date: Fri, 22 Dec 2017 15:39:51 +0545 Subject: [PATCH] updated some issues related to snippets --- snippets/helpers/file-helper.json | 8 ++++---- snippets/helpers/html.json | 28 ++++++++++++++-------------- snippets/helpers/inflector.json | 12 ++++++------ snippets/helpers/json.json | 6 +++--- snippets/helpers/string-helper.json | 22 +++++++++++----------- snippets/helpers/url.json | 18 +++++++++--------- snippets/helpers/var-dumper.json | 6 +++--- snippets/jquery.json | 4 ++-- snippets/yii.json | 8 ++++---- 9 files changed, 56 insertions(+), 56 deletions(-) diff --git a/snippets/helpers/file-helper.json b/snippets/helpers/file-helper.json index 285c313..75b1102 100644 --- a/snippets/helpers/file-helper.json +++ b/snippets/helpers/file-helper.json @@ -6,7 +6,7 @@ }, "FileHelper::createDirectory": { "prefix": "FileHelper::createDirectory", - "body": "FileHelper::createDirectory(\\$${path}, \\$${mode = 509}, \\$${recursive = true})$3", + "body": "FileHelper::createDirectory(\\$${path}, \\$${mode = 509}, \\$${recursive = ${5|true, false|}})$3", "description": "Creates a new directory." }, "FileHelper::filterPath": { @@ -26,7 +26,7 @@ }, "FileHelper::getMimeType": { "prefix": "FileHelper::getMimeType", - "body": "FileHelper::getMimeType(\\$${file}, \\$${magicFile = null}, \\$${checkedExtension = true})$3", + "body": "FileHelper::getMimeType(\\$${file}, \\$${magicFile = null}, \\$${checkedExtension = ${5|true, false|}})$3", "description": "Determines the MIME type of the specified file." }, "FileHelper::getMimeTypeByExtension": { @@ -36,12 +36,12 @@ }, "FileHelper::loadMimeTypes": { "prefix": "FileHelper::loadMimeTypes", - "body": "FileHelper::loadMimeTypes(\\$${magicFile})$3", + "body": "FileHelper::loadMimeTypes(\\$${1:magicFile})$2", "description": "Loads MIME types from the specified file." }, "FileHelper::localize": { "prefix": "FileHelper::localize", - "body": "FileHelper::localize(\\$${file}, \\$${language = null}, \\$${sourceLanguage = null})$3", + "body": "FileHelper::localize(\\$${1:file}, \\$${2:language = null}, \\$${3:sourceLanguage = null})$4", "description": "Returns the localized version of a specified file." }, "FileHelper::normalizePath": { diff --git a/snippets/helpers/html.json b/snippets/helpers/html.json index 602c17f..5c090b7 100644 --- a/snippets/helpers/html.json +++ b/snippets/helpers/html.json @@ -1,42 +1,42 @@ { "Html::a": { "prefix": "Html::a", - "body": "Html::a(\\$${text}, \\$${url}, \\$${options = []})$3", + "body": "Html::a(\\$${1:text}, \\$${2:url}, \\$${3:options = []})$4", "description": "Generates a hyperlink tag." }, "Html::activeBooleanInput": { "prefix": "Html::activeBooleanInput", - "body": "Html::activeBooleanInput(\\$${type}, \\$${model}, \\$${attribute}, \\$${options = []})$3", + "body": "Html::activeBooleanInput(\\$${1:type}, \\$${2:model}, \\$${3:attribute}, \\$${4:options = []})$5", "description": "Generates a boolean input This method is mainly called by activeCheckbox() and activeRadio()." }, "Html::activeCheckbox": { "prefix": "Html::activeCheckbox", - "body": "Html::activeCheckbox(\\$${model}, \\$${attribute}, \\$${options = []})$3", + "body": "Html::activeCheckbox(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4", "description": "Generates a checkbox tag together with a label for the given model attribute." }, "Html::activeCheckboxList": { "prefix": "Html::activeCheckboxList", - "body": "Html::activeCheckboxList(\\$${model}, \\$${attribute}, \\$${items}, \\$${options = []})$3", + "body": "Html::activeCheckboxList(\\$${1:model}, \\$${2:attribute}, \\$${3:items}, \\$${4:options = []})$5", "description": "Generates a list of checkboxes." }, "Html::activeDropDownList": { "prefix": "Html::activeDropDownList", - "body": "Html::activeDropDownList(\\$${model}, \\$${attribute}, \\$${items}, \\$${options = []})$3", + "body": "Html::activeDropDownList(\\$${1:model}, \\$${2:attribute}, \\$${3:items}, \\$${4:options = []})$5", "description": "Generates a drop-down list for the given model attribute." }, "Html::activeFileInput": { "prefix": "Html::activeFileInput", - "body": "Html::activeFileInput(\\$${model}, \\$${attribute}, \\$${options = []})$3", + "body": "Html::activeFileInput(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4", "description": "Generates a file input tag for the given model attribute." }, "Html::activeHiddenInput": { "prefix": "Html::activeHiddenInput", - "body": "Html::activeHiddenInput(\\$${model}, \\$${attribute}, \\$${options = []})$3", + "body": "Html::activeHiddenInput(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4", "description": "Generates a hidden input tag for the given model attribute." }, "Html::activeHint": { "prefix": "Html::activeHint", - "body": "Html::activeHint(\\$${model}, \\$${attribute}, \\$${options = []})$3", + "body": "Html::activeHint(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4", "description": "Generates a hint tag for the given model attribute." }, "Html::activeInput": { @@ -131,7 +131,7 @@ }, "Html::cssFile": { "prefix": "Html::cssFile", - "body": "Html::cssFile(\\$${url}, \\$${options = []})$3", + "body": "Html::cssFile(\\$${1:url}, \\$${1:options = []})$3", "description": "Generates a link tag that refers to an external CSS file." }, "Html::cssStyleFromArray": { @@ -146,17 +146,17 @@ }, "Html::decode": { "prefix": "Html::decode", - "body": "Html::decode($content})$3", + "body": "Html::decode(\\$${1:content})$2", "description": "Decodes special HTML entities back to the corresponding characters." }, "Html::dropDownList": { "prefix": "Html::dropDownList", - "body": "Html::dropDownList($name}, \\$${selection = null}, \\$${items = []}, \\$${options = []})$3", + "body": "Html::dropDownList(\\$${1:name}, \\$${2:selection = null}, \\$${3:items = []}, \\$${4:options = []})$5", "description": "Generates a drop-down list." }, "Html::encode": { "prefix": "Html::encode", - "body": "Html::encode($content}, \\$${doubleEncode = true})$3", + "body": "Html::encode(\\$${1:content}, \\$${2:doubleEncode = true})$3", "description": "Encodes special characters into HTML entities." }, "Html::endForm": { @@ -166,12 +166,12 @@ }, "Html::endTag": { "prefix": "Html::endTag", - "body": "Html::endTag($name})$3", + "body": "Html::endTag(\\$${1:name})$2", "description": "Generates an end tag." }, "Html::error": { "prefix": "Html::error", - "body": "Html::error($model, \\$${attribute}, \\$${options = []})$3", + "body": "Html::error(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4", "description": "Generates a tag that contains the first validation error of the specified model attribute." } } \ No newline at end of file diff --git a/snippets/helpers/inflector.json b/snippets/helpers/inflector.json index 8c6cd55..4bcc1e6 100644 --- a/snippets/helpers/inflector.json +++ b/snippets/helpers/inflector.json @@ -31,7 +31,7 @@ }, "Inflector::ordinalize": { "prefix": "Inflector::ordinalize", - "body": "Inflector::ordinalize(\\$${number})$3", + "body": "Inflector::ordinalize(\\$${1:number})$2", "description": "Ordinalize number." }, "Inflector::pluralize": { @@ -46,7 +46,7 @@ }, "Inflector::singularize": { "prefix": "Inflector::singularize", - "body": "Inflector::singularize(\\$${word})$3", + "body": "Inflector::singularize(\\$${1:word})$2", "description": "Singularize word." }, "Inflector::slug": { @@ -56,7 +56,7 @@ }, "Inflector::tableize": { "prefix": "Inflector::tableize", - "body": "Inflector::tableize(\\$${className})$3", + "body": "Inflector::tableize(\\$${1:className})$2", "description": "Creats a tableize string." }, "Inflector::titleize": { @@ -66,17 +66,17 @@ }, "Inflector::transliterate": { "prefix": "Inflector::transliterate", - "body": "Inflector::transliterate(\\$${1:string}, \\$${2:transliterator ${5|true, false|}})$3", + "body": "Inflector::transliterate(\\$${1:string}, \\$${2:transliterator ${3|true, false|}})$4", "description": "Creats a transliterate string." }, "Inflector::underscore": { "prefix": "Inflector::underscore", - "body": "Inflector::underscore(\\$${words})$3", + "body": "Inflector::underscore(\\$${1:words})$2", "description": "Creats a underscore string." }, "Inflector::variablize": { "prefix": "Inflector::variablize", - "body": "Inflector::variablize(\\$${word})$3", + "body": "Inflector::variablize(\\$${1:word})$2", "description": "Creats a variablize string." } } \ No newline at end of file diff --git a/snippets/helpers/json.json b/snippets/helpers/json.json index 2a78f76..33a7292 100644 --- a/snippets/helpers/json.json +++ b/snippets/helpers/json.json @@ -1,17 +1,17 @@ { "Json::decode": { "prefix": "Json::decode", - "body": "Json::decode(\\$${json}, \\$${asArray = true})$3", + "body": "Json::decode(\\$${1:json}, \\$${2:asArray = ${3|true, false|}})$4", "description": "Decodes the given JSON string into a PHP data structure." }, "Json::encode": { "prefix": "Json::encode", - "body": "Json::encode(\\$${json}, \\$${asArray = true})$3", + "body": "Json::encode(\\$${1:json}, \\$${2:asArray = ${3|true, false|}})$4", "description": "Encodes the given value into a JSON string." }, "Json::htmlEncode": { "prefix": "Json::htmlEncode", - "body": "Json::htmlEncode(\\$${value})$3", + "body": "Json::htmlEncode(\\$${1:value})$2", "description": "Encodes the given value into a JSON string HTML-escaping entities so it is safe to be embedded in HTML code." } } \ No newline at end of file diff --git a/snippets/helpers/string-helper.json b/snippets/helpers/string-helper.json index b730380..c67fb62 100644 --- a/snippets/helpers/string-helper.json +++ b/snippets/helpers/string-helper.json @@ -1,57 +1,57 @@ { "StringHelper::basename": { "prefix": "StringHelper::basename", - "body": "StringHelper::basename(\\$${path}, \\$${suffix = ''})$3", + "body": "StringHelper::basename(\\$${1:path}, \\$${2:suffix = ''})$3", "description": "Returns the trailing name component of a path." }, "StringHelper::byteLength": { "prefix": "StringHelper::byteLength", - "body": "StringHelper::byteLength(\\$${string})$3", + "body": "StringHelper::byteLength(\\$${1:string})$2", "description": "Returns the number of bytes in the given string." }, "StringHelper::byteSubstr": { "prefix": "StringHelper::byteSubstr", - "body": "StringHelper::byteSubstr(\\$${string}, \\$${start}, \\$${length = null})$3", + "body": "StringHelper::byteSubstr(\\$${1:string}, \\$${2:start}, \\$${3:length = null})$4", "description": "Returns the portion of string specified by the start and length parameters." }, "StringHelper::countWords": { "prefix": "StringHelper::countWords", - "body": "StringHelper::countWords(\\$${string})$3", + "body": "StringHelper::countWords(\\$${1:string})$2", "description": "Counts words in a string" }, "StringHelper::dirname": { "prefix": "StringHelper::dirname", - "body": "StringHelper::dirname(\\$${path})$3", + "body": "StringHelper::dirname(\\$${1:path})$2", "description": "Returns parent directory's path." }, "StringHelper::endsWith": { "prefix": "StringHelper::endsWith", - "body": "StringHelper::endsWith(\\$${path})$3", + "body": "StringHelper::endsWith(\\$${1:path})$2", "description": "Check if given string ends with specified substring." }, "StringHelper::explode": { "prefix": "StringHelper::explode", - "body": "StringHelper::explode(\\$${string, \\$${delimiter = ','}, \\$${trim = true}, \\$${skipEmpty = false})$3", + "body": "StringHelper::explode(\\$${1:string, \\$${2:delimiter = ','}, \\$${3:trim = ${4|true, false|}}, \\$${5:skipEmpty = ${6|true, false|}})$7", "description": "Explodes string into array, optionally trims values and skips empty ones" }, "StringHelper::startsWith": { "prefix": "StringHelper::startsWith", - "body": "StringHelper::startsWith(\\$${string}, \\$${with}, \\$${caseSensitive = true})$3", + "body": "StringHelper::startsWith(\\$${1:string}, \\$${2:with}, \\$${3:caseSensitive = ${5|true, false|}})$5", "description": "Check if given string starts with specified substring." }, "StringHelper::truncate": { "prefix": "StringHelper::truncate", - "body": "StringHelper::truncate(\\$${string}, \\$${with}, \\$${caseSensitive = true})$3", + "body": "StringHelper::truncate(\\$${1:string}, \\$${2:with}, \\$${3:caseSensitive = ${4|true, false|}})$5", "description": "Truncates a string to the number of characters specified." }, "StringHelper::truncateHtml": { "prefix": "StringHelper::truncateHtml", - "body": "StringHelper::truncateHtml(\\$${string}, \\$${count}, \\$${suffix}, \\$${encoding = false})$3", + "body": "StringHelper::truncateHtml(\\$${1:string}, \\$${2:count}, \\$${3:suffix}, \\$${4:encoding = ${5|true, false|}})$6", "description": "Truncate a string while preserving the HTML." }, "StringHelper::truncateWords": { "prefix": "StringHelper::truncateWords", - "body": "StringHelper::truncateWords(\\$${string}, \\$${count}, \\$${suffix = '...'}, \\$${asHtml = false})$3", + "body": "StringHelper::truncateWords(\\$${1:string}, \\$${2:count}, \\$${3:suffix = '...'}, \\$${4:asHtml = ${5|true, false|}})$6", "description": "Truncates a string to the number of words specified." } } \ No newline at end of file diff --git a/snippets/helpers/url.json b/snippets/helpers/url.json index 6bbc5ed..a11c3c9 100644 --- a/snippets/helpers/url.json +++ b/snippets/helpers/url.json @@ -1,7 +1,7 @@ { "Url::base": { "prefix": "Url::base", - "body": "Url::base(\\$${schema = false})$3", + "body": "Url::base(\\$${1:schema = ${2|true, false|}})$3", "description": "Returns the base URL of the current request." }, "Url::canonical": { @@ -11,42 +11,42 @@ }, "Url::current": { "prefix": "Url::current", - "body": "Url::current(${['src' => null]})$3", + "body": "Url::current(${['src' => null]})$2", "description": "Creates a URL by using the current route and the GET parameters." }, "Url::home": { "prefix": "Url::home", - "body": "Url::home(\\$${schema = null]})$3", + "body": "Url::home(\\$${1:schema = null]})$3", "description": "Returns the home URL." }, "Url::isRelative": { "prefix": "Url::isRelative", - "body": "Url::isRelative(\\$${url})$3", + "body": "Url::isRelative(\\$${1:url})$2", "description": "Returns a value indicating whether a URL is relative." }, "Url::normalizeRoute": { "prefix": "Url::normalizeRoute", - "body": "Url::normalizeRoute(\\$${route})$3", + "body": "Url::normalizeRoute(\\$${1:route})$2", "description": "Normalizes route and makes it suitable for UrlManager. Absolute routes are staying as is while relative routes are converted to absolute ones." }, "Url::previous": { "prefix": "Url::previous", - "body": "Url::previous(\\$${name = null})$3", + "body": "Url::previous(\\$${1:name = null})$2", "description": "Returns the URL previously remembered." }, "Url::remember": { "prefix": "Url::remember", - "body": "Url::remember(\\$${name = null})$3", + "body": "Url::remember(\\$${1:name = null})$2", "description": "Remembers the specified URL so that it can be later fetched back by previous()." }, "Url::to": { "prefix": "Url::to", - "body": "Url::to(\\$${url}, \\$${schema = false})$3", + "body": "Url::to(\\$${1:url}, \\$${2:schema = ${3|true, false|}})$4", "description": "Creates a URL based on the given parameters." }, "Url::toRoute": { "prefix": "Url::toRoute", - "body": "Url::toRoute(\\$${route}, \\$${schema = false})$3", + "body": "Url::toRoute(\\$${1:route}, \\$${2:schema = ${3|true, false|}})$4", "description": "Creates a URL for the given route." } } \ No newline at end of file diff --git a/snippets/helpers/var-dumper.json b/snippets/helpers/var-dumper.json index ab4fc3f..2dea439 100644 --- a/snippets/helpers/var-dumper.json +++ b/snippets/helpers/var-dumper.json @@ -1,17 +1,17 @@ { "VarDumper::dump": { "prefix": "VarDumper::dump", - "body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = false})$3", + "body": "VarDumper::dump( \\$${1:var}, \\$${2:depth = 10}, \\$${3:highlight = ${4|true, false|}})$5", "description": "Displays a variable." }, "VarDumper::dumpAsString()": { "prefix": "VarDumper::dumpAsString()", - "body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = false})$3", + "body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = ${5|true, false|}})$3", "description": "Returns the values of a specified column in an array." }, "VarDumper::export": { "prefix": "VarDumper::export", - "body": "VarDumper::export(\\$${var})$3", + "body": "VarDumper::export(\\$${1:var})$2", "description": "Exports a variable as a string representation." } } \ No newline at end of file diff --git a/snippets/jquery.json b/snippets/jquery.json index e76e7ac..a849c46 100644 --- a/snippets/jquery.json +++ b/snippets/jquery.json @@ -1,5 +1,5 @@ { - "js on click" : { + "jsonclick" : { "prefix" : "js on click", "body": [ "\\$this->register('", @@ -11,7 +11,7 @@ ], "description": "js on click" }, - "js on click ajax" : { + "jsonclickajax" : { "prefix" : "js on click ajax", "body": [ "\\$this->register('", diff --git a/snippets/yii.json b/snippets/yii.json index f8d8245..b08c4cc 100644 --- a/snippets/yii.json +++ b/snippets/yii.json @@ -46,12 +46,12 @@ }, "Yii::getObjectVars": { "prefix": "Yii::getObjectVars", - "body": "Yii::getObjectVars(\\$${object});", + "body": "Yii::getObjectVars(\\$${1:object});", "description": "Returns the public member variables of an object." }, "Yii::getRootAlias": { "prefix": "Yii::getRootAlias", - "body": "Yii::getRootAlias(\\$${alias});", + "body": "Yii::getRootAlias(\\$${1:alias});", "description": "Returns the root alias part of a given alias." }, "Yii::getVersion": { @@ -71,12 +71,12 @@ }, "Yii::setAlias": { "prefix": "Yii::setAlias", - "body": "Yii::setAlias(\\$${alias}, \\$${path});", + "body": "Yii::setAlias(\\$${1:alias}, \\$${2:path});", "description": "Registers a path alias." }, "Yii::setLogger": { "prefix": "Yii::setLogger", - "body": "Yii::setLogger(\\$${logger});", + "body": "Yii::setLogger(\\$${1:logger});", "description": "Sets the logger object." }, "Yii::t": {