Completions, hover documentation, diagnostics, quick fixes, and snippets for HTMX 2 and 4 in VS Code, plus completion, navigation, and rename for Django 6 template partials. Everything runs from a committed catalog with no network requests.
Documentation · Installation · Why · Features · Settings · Development
Install HTMX Django IntelliSense from the
Visual Studio Marketplace
or Open VSX,
or from the Quick Open palette (Ctrl/Cmd+P):
ext install difegam3.htmx-django-intellisense
Alternatively, install a local VSIX from a checkout:
npm install
npm run package
code --install-extension htmx-django-intellisense-*.vsix --forceIf you use VS Code profiles, this installs into the
default profile's extension pool. If the extension doesn't show up in the Extensions view, check which
profile your workspace uses and reinstall with --profile "<your-profile-name>".
Django template support requires the
Django extension,
which VS Code installs as an extension dependency. Open an html or
django-html template and type hx- to verify activation.
Read the full documentation for guides on authoring HTMX, Django partials, configuration, testing, packaging, and releases.
- Both HTMX majors. One catalog covers HTMX
2.0.11and4.0.0. Version-specific attributes, values, and modifiers are labelled, and a single setting narrows suggestions to one major. - Context, not a word list.
hx-swap,hx-trigger, andhx-targetsuggest the strategies, events, and modifiers that fit where the cursor is. - Mistakes caught as you type. Misspelled attributes, invalid documented values, deprecated attributes, and unknown partials are flagged with a quick fix.
- Django 6 partials are first-class.
{% partialdef %}and{% partial %}complete, navigate, rename, and resolve acrosstemplate.html#partialreferences in templates and Python. - Django-ready snippets. CSRF-safe POST, delete, search, infinite scroll, modals, out-of-band swaps, and partial responses.
- Offline. The extension reads its committed catalog and makes no runtime network requests.
Type hx- in HTML or Django HTML to see every HTMX attribute with its
description and version availability. HTMX 4-only attributes are badged, and
aliases, data-hx-*, and dynamic syntax such as hx-on:<event> complete too.
Values are suggested for the attribute being edited. hx-trigger offers
events and then modifiers such as changed and delay:, and hx-swap offers
strategies, with HTMX 4 strategies such as innerMorph labelled, followed by
modifiers such as transition:.
Hover a recognized hx-* or data-hx-* attribute for its purpose, supported
HTMX versions, categories, values and modifiers, an example, and links to the
official HTMX 2 and HTMX 4 documentation.
The extension reports misspelled HTMX attributes, deprecated attributes,
invalid documented values, and unknown or duplicate Django partials. Typos,
deprecated attributes, invalid values, and unknown partials offer a fix from the
Ctrl/Cmd+. lightbulb; duplicate partials and version mismatches are warnings only.
Definitions in the current template are offered after {% partial :
{% partialdef result_card inline %}
<article id="result-{{ result.pk }}">{{ result.title }}</article>
{% endpartialdef %}
{% partial result_card %}Find All References (Shift+F12) and Rename Symbol (F2) work across the workspace: the partialdef, every {% partial %} tag, {% include %} references, and Python view strings are listed and rewritten together. Ctrl/Cmd+click on the template path in any of those references opens the template file. Duplicate {% partialdef %} definitions are flagged with a quick fix to rename the later one.
Static cross-template references also complete and navigate from Django includes and common Python APIs:
{% include "results.html#result_card" %}return render(request, "results.html#result_card", context)See the Django partials guide for lookup rules, diagnostics, and cross-template behavior.
Type a snippet prefix in a django-html document to insert a secure,
Django-ready HTMX pattern, then Tab through its placeholders. See the
snippet and example catalog for every prefix and
its generated output.
| Requirement | Supported |
|---|---|
| VS Code | 1.90 or later |
| HTMX | 2.0.11 and 4.0.0 |
| Django | Templates via batisteo.vscode-django; partials need 6.0+ |
compatible mode is the default and accepts the union of both HTMX versions.
Choose 2 or 4 to surface cross-version syntax as hints.
| Setting | Default | Purpose |
|---|---|---|
htmxDjango.enableCompletion |
true |
Enable HTMX and Django partial completions. |
htmxDjango.enableHover |
true |
Enable HTMX and partial hover information. |
htmxDjango.enableValidation |
true |
Enable HTMX and same-file partial diagnostics. |
htmxDjango.version |
compatible |
Use compatible, 2, or 4. |
See the configuration guide and settings reference for details.
This repository contains the TypeScript VS Code extension and a Python
toolchain under tools/ that generates the offline HTMX catalog and snippets.
Install uv, npm, and Just,
then run:
just init
just verifyjust init installs both toolchains and the prek git hooks. just verify
runs the complete local CI checklist: linting, type checks, Python and
TypeScript tests, artifact drift checks, extension-host tests, the docs build,
VSIX packaging, and the Python package build.
Useful focused commands:
npm test
npm run test:extension
npm run packageAfter changing catalog inputs or snippet sources, regenerate the committed
artifacts with npm run build-data or npm run build-snippets. See the
first contribution guide and
CI and packaging guide for the full
workflow.
Licensed under Apache 2.0. Maintained independently at difegam/htmx-django-intellisense.






