Otherwise fall back to dockerfile-mode.
This also acts as an experiment of how to go about using the new Emacs
29.x treesit backed modes if available. This is currently not that
clean, but will do for now, and I'll keep experimenting with it.
Default on-save formatting is still done via lsp-format-buffer, but the
the C-c C-f manual formatting action is overridden to also include
stree-format-buffer.
In fact, registering them, will override existing servers. When
registering the golangci-lint server, it prevents the regular gopls
server from being used.
The field_identifier type was recently removed from tree-sitter-go here:
https://github.com/tree-sitter/tree-sitter-go/pull/71
This means that struct keys are no longer syntax highlighted as
properties, which I dislike. Hence this new query targets the first
element of a key/value pair, and marks the first element as a @property
if it contains an identifier.
I'm not sure if this undoes the goal of removing the field_identifier,
but for now, it resolves my personal annoyance of struct keys not be
highlighted as properties when creating a new instance of the struct.
Caddy can now format Caddyfiles with the "caddy fmt" command, so we use
reformatter to create a format-on-save mode for Caddyfiles.
Also there's no need for the weird whitespace-mode workaround, as we now
use tab indentation in Caddyfiles, since that's what "caddy fmt"
produces.
The terraform language server is not very good, very rarely provides any
completions, and when it doesn't it overall is just slow and laggy.
Especially so as lsp-mode is set to syntax highlight with the language
server, causing syntax highlighting to often be about 5 seconds behind
of whatever you're typing.
As I'm no longer using whitespace-mode in prog-mode derived modes, the
cursor movement bug affecting highlight-indent-guides when
whitespace-mode is enabled is no longer an issue for me.
Further details about the highlight-indent-guides conflict with
whitespace-mode is available in this issue:
https://github.com/DarthFennec/highlight-indent-guides/issues/107