From 3dbda816615429094c60ddb68331cc272de529b3 Mon Sep 17 00:00:00 2001 From: Fikir Date: Wed, 22 Jul 2026 22:17:24 +0300 Subject: [PATCH 1/2] support for new template tags from django 6.0 --- snippets/templates/tags.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/snippets/templates/tags.json b/snippets/templates/tags.json index d736a1a..53cb31b 100644 --- a/snippets/templates/tags.json +++ b/snippets/templates/tags.json @@ -479,5 +479,19 @@ "{% endwith %}" ], "description": "{% with %} (paste) {% endwith %}" + }, + "partialdef": { + "prefix": "partialdef", + "body": [ + "{% partialdef $1 %}", + "\t${2:$TM_SELECTED_TEXT}", + "{% endpartialdef %}" + ], + "description": "{% partialdef %} {% endpartialdef %}" + }, + "partial": { + "prefix": "partial", + "body": "{% partial $1 %}", + "description": "{% partial '...' %}" } } From 1222a2f67b125ce9702ac58ffd95d872fc0e0053 Mon Sep 17 00:00:00 2001 From: Fikir Date: Thu, 23 Jul 2026 13:47:24 +0300 Subject: [PATCH 2/2] Support for django 6.0 template tags --- README.md | 168 ++++++++++++++++++----------------- package-lock.json | 19 ++-- package.json | 2 +- snippets/templates/tags.json | 28 +++--- 4 files changed, 110 insertions(+), 107 deletions(-) diff --git a/README.md b/README.md index 44e2ab8..2adc243 100644 --- a/README.md +++ b/README.md @@ -133,14 +133,14 @@ Press (ctrl+shift+/)or(cmd+shift+/) to comment and uncomme ### _**imports**_ / _**general**_ -| Trigger | Description | -| ------------ | ---------------------------------------------- | -| `iappforms` | Import \- app.forms | -| `iappmodels` | Import \- app.models | -| `iappviews` | Import \- app.views | -| `ireverse` | from django.urls import reverse | -| `isettings` | from django.conf import settings | -| `iusermodel` | from django.contrib.auth import get_user_model | +| Trigger | Description | +| ------------ | ------------------------------------------------ | +| `iappforms` | Import \- app.forms | +| `iappmodels` | Import \- app.models | +| `iappviews` | Import \- app.views | +| `ireverse` | from django.urls import reverse | +| `isettings` | from django.conf import settings | +| `iusermodel` | from django.contrib.auth import get\_user\_model | ### _**models**_ / _**classes**_ @@ -206,20 +206,20 @@ Press (ctrl+shift+/)or(cmd+shift+/) to comment and uncomme ### _**models**_ / _**methods**_ -| Trigger | Description | -| ------------------ | -------------------------- | -| `get_absolute_url` | Method \- get_absolute_url | -| `receiver` | Method \- receiver | -| `str` | Method \- \_\_str\_\_ | +| Trigger | Description | +| ------------------ | ---------------------------- | +| `get_absolute_url` | Method \- get\_absolute\_url | +| `receiver` | Method \- receiver | +| `str` | Method \- \_\_str\_\_ | ### _**python**_ / _**imports**_ -| Trigger | Description | -| ------------ | ------------------------------------------- | -| `inpdb` | Import \- nose pdb debug tool | -| `ipdb` | Import \- ipdb debug tool | -| `itraceback` | Import \- traceback print exception | -| `iul` | from \_\_future\_\_ import unicode_literals | +| Trigger | Description | +| ------------ | -------------------------------------------- | +| `inpdb` | Import \- nose pdb debug tool | +| `ipdb` | Import \- ipdb debug tool | +| `itraceback` | Import \- traceback print exception | +| `iul` | from \_\_future\_\_ import unicode\_literals | ### _**python**_ / _**methods**_ @@ -229,64 +229,64 @@ Press (ctrl+shift+/)or(cmd+shift+/) to comment and uncomme ### _**templates**_ / _**filters**_ -| Trigger | Description | -| ---------------------- | -------------------------------- | -| `\|add` | Filter \- add:Arg | -| `\|addslashes` | Filter \- addslashes | -| `\|capfirst` | Filter \- capfirst | -| `\|center` | Filter \- center:Arg | -| `\|cut` | Filter \- cut:Arg | -| `\|date` | Filter \- date | -| `\|default` | Filter \- default:Arg | -| `\|default_if_none` | Filter \- default_if_none:Arg | -| `\|dictsort` | Filter \- dictsort:Arg | -| `\|dictsortreversed` | Filter \- dictsortreversed:Arg | -| `\|divisibleby` | Filter \- divisibleby:Arg | -| `\|escape` | Filter \- escape | -| `\|escapejs` | Filter \- escapejs | -| `\|filesizeformat` | Filter \- filesizeformat | -| `\|first` | Filter \- first | -| `\|floatformat` | Filter \- floatformat | -| `\|force_escape` | Filter \- force_escape | -| `\|get_digit` | Filter \- get_digit | -| `\|iriencode` | Filter \- iriencode | -| `\|join` | Filter \- join:Arg | -| `\|last` | Filter \- last | -| `\|length` | Filter \- length | -| `\|length_is` | Filter \- length_is:Arg | -| `\|linebreaks` | Filter \- linebreaks | -| `\|linebreaksbr` | Filter \- linebreaksbr | -| `\|linenumbers` | Filter \- linenumbers | -| `\|ljust` | Filter \- ljust | -| `\|lower` | Filter \- lower | -| `\|make_list` | Filter \- make_list | -| `\|phone2numeric` | Filter \- phone2numeric | -| `\|pluralize` | Filter \- pluralize | -| `\|pprint` | Filter \- pprint | -| `\|random` | Filter \- random | -| `\|rjust` | Filter \- rjust | -| `\|safe` | Filter \- safe | -| `\|safeseq` | Filter \- safeseq | -| `\|slice` | Filter \- slice:Arg | -| `\|slugify` | Filter \- slugify | -| `\|stringformat` | Filter \- stringformat | -| `\|striptags` | Filter \- striptags | -| `\|time` | Filter \- time:Arg | -| `\|timesince` | Filter \- timesince:Arg | -| `\|timeuntil` | Filter \- timeuntil:Arg | -| `\|title` | Filter \- title | -| `\|truncatechars` | Filter \- truncatechars:Arg | -| `\|truncatechars_html` | Filter \- truncatechars_html:Arg | -| `\|truncatewords` | Filter \- truncatewords:Arg | -| `\|truncatewords_html` | Filter \- truncatewords_html:Arg | -| `\|unordered_list` | Filter \- unordered_list | -| `\|upper` | Filter \- upper | -| `\|urlencode` | Filter \- urlencode | -| `\|urlize` | Filter \- urlize | -| `\|urlizetrunc` | Filter \- urlizetrunc | -| `\|wordcount` | Filter \- wordcount | -| `\|wordwrap` | Filter \- wordwrap | -| `\|yesno` | Filter \- yesno:Arg | +| Trigger | Description | +| ---------------------- | --------------------------------- | +| `\|add` | Filter \- add:Arg | +| `\|addslashes` | Filter \- addslashes | +| `\|capfirst` | Filter \- capfirst | +| `\|center` | Filter \- center:Arg | +| `\|cut` | Filter \- cut:Arg | +| `\|date` | Filter \- date | +| `\|default` | Filter \- default:Arg | +| `\|default_if_none` | Filter \- default\_if\_none:Arg | +| `\|dictsort` | Filter \- dictsort:Arg | +| `\|dictsortreversed` | Filter \- dictsortreversed:Arg | +| `\|divisibleby` | Filter \- divisibleby:Arg | +| `\|escape` | Filter \- escape | +| `\|escapejs` | Filter \- escapejs | +| `\|filesizeformat` | Filter \- filesizeformat | +| `\|first` | Filter \- first | +| `\|floatformat` | Filter \- floatformat | +| `\|force_escape` | Filter \- force\_escape | +| `\|get_digit` | Filter \- get\_digit | +| `\|iriencode` | Filter \- iriencode | +| `\|join` | Filter \- join:Arg | +| `\|last` | Filter \- last | +| `\|length` | Filter \- length | +| `\|length_is` | Filter \- length\_is:Arg | +| `\|linebreaks` | Filter \- linebreaks | +| `\|linebreaksbr` | Filter \- linebreaksbr | +| `\|linenumbers` | Filter \- linenumbers | +| `\|ljust` | Filter \- ljust | +| `\|lower` | Filter \- lower | +| `\|make_list` | Filter \- make\_list | +| `\|phone2numeric` | Filter \- phone2numeric | +| `\|pluralize` | Filter \- pluralize | +| `\|pprint` | Filter \- pprint | +| `\|random` | Filter \- random | +| `\|rjust` | Filter \- rjust | +| `\|safe` | Filter \- safe | +| `\|safeseq` | Filter \- safeseq | +| `\|slice` | Filter \- slice:Arg | +| `\|slugify` | Filter \- slugify | +| `\|stringformat` | Filter \- stringformat | +| `\|striptags` | Filter \- striptags | +| `\|time` | Filter \- time:Arg | +| `\|timesince` | Filter \- timesince:Arg | +| `\|timeuntil` | Filter \- timeuntil:Arg | +| `\|title` | Filter \- title | +| `\|truncatechars` | Filter \- truncatechars:Arg | +| `\|truncatechars_html` | Filter \- truncatechars\_html:Arg | +| `\|truncatewords` | Filter \- truncatewords:Arg | +| `\|truncatewords_html` | Filter \- truncatewords\_html:Arg | +| `\|unordered_list` | Filter \- unordered\_list | +| `\|upper` | Filter \- upper | +| `\|urlencode` | Filter \- urlencode | +| `\|urlize` | Filter \- urlize | +| `\|urlizetrunc` | Filter \- urlizetrunc | +| `\|wordcount` | Filter \- wordcount | +| `\|wordwrap` | Filter \- wordwrap | +| `\|yesno` | Filter \- yesno:Arg | ### _**templates**_ / _**imports**_ @@ -317,7 +317,7 @@ Press (ctrl+shift+/)or(cmd+shift+/) to comment and uncomme | `comment` | \{\# \#\} | | `comment_block` | \{% comment %\} \{% endcomment %\} | | `comment_paste` | \{% comment %\} \(paste\) \{% endcomment %\} | -| `csrf_token` | \{% csrf_token %\} | +| `csrf_token` | \{% csrf\_token %\} | | `cycle` | \{% cycle %\} | | `debug` | \{% debug %\} | | `elif` | \{% elif %\} | @@ -350,6 +350,8 @@ Press (ctrl+shift+/)or(cmd+shift+/) to comment and uncomme | `include` | \{% include '...' %\} | | `lorem` | \{% lorem %\} | | `now` | \{% now %\} | +| `partial` | \{% partial '...' %\} | +| `partialdef` | \{% partialdef %\} \{% endpartialdef %\} | | `regroup` | \{% regroup %\} | | `regroup_example` | \{% regroup %\} \(example\) | | `resetcycle` | \{% resetcycle %\} | @@ -454,11 +456,11 @@ Press (ctrl+shift+/)or(cmd+shift+/) to comment and uncomme ### _**views**_ / _**methods**_ -| Trigger | Description | -| ------------------ | -------------------------- | -| `dispatch` | Method \- dispatch | -| `get_context_data` | Method \- get_context_data | -| `get_queryset` | Method \- get_queryset | +| Trigger | Description | +| ------------------ | ---------------------------- | +| `dispatch` | Method \- dispatch | +| `get_context_data` | Method \- get\_context\_data | +| `get_queryset` | Method \- get\_queryset | diff --git a/package-lock.json b/package-lock.json index 05db974..a60ac49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "esbuild": "^0.24.0", "eslint": "^9.12.0", "node-polyfill-webpack-plugin": "^4.0.0", - "prettier": "^2.8.8", + "prettier": "3.9.6", "ts-loader": "^9.5.1", "typescript": "^5.5.4", "typescript-eslint": "^8.9.0", @@ -3293,15 +3293,16 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", + "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", "dev": true, + "license": "MIT", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -6592,9 +6593,9 @@ "dev": true }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", + "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", "dev": true }, "process": { diff --git a/package.json b/package.json index 2305b79..03a4e98 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "esbuild": "^0.24.0", "eslint": "^9.12.0", "node-polyfill-webpack-plugin": "^4.0.0", - "prettier": "^2.8.8", + "prettier": "3.9.6", "ts-loader": "^9.5.1", "typescript": "^5.5.4", "typescript-eslint": "^8.9.0", diff --git a/snippets/templates/tags.json b/snippets/templates/tags.json index 53cb31b..2158379 100644 --- a/snippets/templates/tags.json +++ b/snippets/templates/tags.json @@ -343,6 +343,20 @@ "body": "{% now '${1|DATE_FORMAT,DATETIME_FORMAT,SHORT_DATE_FORMAT,SHORT_DATETIME_FORMAT,Y-m-d H:i|}' %}", "description": "{% now %}" }, + "partial": { + "prefix": "partial", + "body": "{% partial $1 %}", + "description": "{% partial '...' %}" + }, + "partialdef": { + "prefix": "partialdef", + "body": [ + "{% partialdef $1 %}", + "\t${2:$TM_SELECTED_TEXT}", + "{% endpartialdef %}" + ], + "description": "{% partialdef %} {% endpartialdef %}" + }, "regroup": { "prefix": "regroup", "body": "{% regroup $1 by $2 as ${3:_list} %}", @@ -479,19 +493,5 @@ "{% endwith %}" ], "description": "{% with %} (paste) {% endwith %}" - }, - "partialdef": { - "prefix": "partialdef", - "body": [ - "{% partialdef $1 %}", - "\t${2:$TM_SELECTED_TEXT}", - "{% endpartialdef %}" - ], - "description": "{% partialdef %} {% endpartialdef %}" - }, - "partial": { - "prefix": "partial", - "body": "{% partial $1 %}", - "description": "{% partial '...' %}" } }