I am busy implementing the Language Server Protocol so Templ has support for better code completion than current LSP. The goal it to support html, htmx and normal templ syntax and to be able to provide code completion for all of them.
The language server is written in go. Mainly to challenge myself to learn go. Coming from a Typescript background.
It is not published to the extension store, but you can easily install it by following these instructions.
You can download the latest release from the releases page
Or you can build it yourself.
- Clone the repository
git clone https://github.com/baswilson/templ-lsp.git
- Install the go dependencies
cd client && yarn install
cd server && go mod download
- Install vsce globally
npm i -g vsce
- Build the extension (server is built by client)
cd client && vsce package
- Install the extension in VSCode Right click the created file and select "Install Extension VSIX" or Run this command. Replace the version number with the correct version number.
code --install-extension templ-lsp-0.0.1.vsix
Done. You should now have the extension installed.