This extension provides Visual Studio Code with auto-completion support for HTMX's v2 HTML attributes. It accomplishes this by contributing custom data to VS Code's HTML language service.
Because this extension contributes to only this language service, it does not provide support for programming language or templating language file types. For example, VS Code will not understand that your .js
, .cshtml
, and .jinja
files may contain HTMX attributes just because you installed this extension.
This extension supports HTMX v2 while some of the other available extensions support HTMX v1.
I don't think there's anything wrong with that, especially because according to the project homepage:
... It is not currently marked as
latest
in NPM so that people using the 1.x line are not accidentally upgraded.
Unlike other extensions, this one also includes data-*
attribute support.
While not highlighted throughout the official documentation, HTMX allows you to use data-hx-*
attributes as an alternative to hx-*
attributes for the sake of using standard HTML attributes. The feature is mentioned under the "htmx in a Nutshell" section of those docs.
It's worth mentioning that, if you prefer, you can use the
data-
prefix when using htmx:<a data-hx-post="/click">Click Me!</a>
- You want HTMX v2 auto-completion support.
- You want that support to include
data-*
attributes.
- You are using HTMX v1.
- You need incredibly detailed hover-over documentation.
- You need auto-completion in something other than
.html
files.
Just install the extension and start writing HTML with HTMX.
This extension is licensed under the very permissive, open-source BSD-3 Clause license. Details can be found in LICENSE.md
.
The TL;DR of the license is that you can do whatever you want with the extension so long as you don't claim I endorse it.