a-h / templ

A language for writing HTML user interfaces in Go.
https://templ.guide/
MIT License
8.35k stars 276 forks source link

feat: add `templ diagnose` command #840

Closed a-h closed 4 months ago

a-h commented 4 months ago

We're getting a number of reports where people are running a different version of templ than they think they are, or their environment is not set up correctly.

This PR adds a new templ diagnose command to assist with diagnosis of faults.

There's also a JSON mode, which is intended for use by the VS Code and Neovim extensions. The extensions should be upgraded to run this new command (templ diagnose -json) from within the context of the extension, thereby showing users the state of the environment that's visible to the editor, rather than the shell that they run commands at.

a-h commented 4 months ago

I think check sounds better, since diagnose is a more complex word, plus, it clashes with LSP diagnostic warnings.

I'll update it.

a-h commented 4 months ago

Actually, maybe info is a better name. Check also sounds like it could be something that works on files.

joerdav commented 4 months ago

Info is fine too, for reference the neovim equivalent command is :checkhealth

a-h commented 4 months ago

OK, I think that's it.