🤖#4 - djhtml-vscode

I’ve published an early version of a VSCode extension that automatically formats Django templates with djhtml.

This was fun to build, the VSCode API documentation is pretty decent (although lacking examples). Working with a big API like this really highlights the value of Typescript - it was never too hard to figure out what to do with any given part of the API just from reading the type signatures.

One major shortcoming of the extension system is the inability to use non-’published’ APIs from other extensions. I had to copy a whole bunch of code from Microsoft’s Python extension when I’d have rather just called it directly - my extension relies on it for retrieving the Python environment anyway.

Publishing was surprisingly smooth, other than having to jump through Microsoft’s 5 layers of login screens.

Of course, just after publishing I discovered djlint and associated extension🤷.