Files
.emacs.d/modules/languages/siren-terraform.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

51 lines
1.3 KiB
EmacsLisp

;;; siren-terraform.el --- jimeh's Emacs Siren: terraform-mode configuration. -*- lexical-binding: nil; -*-
;;; Commentary:
;; Basic configuration for terraform-mode.
;;; Code:
(require 'siren-lsp)
(require 'siren-reformatter)
(use-package terraform-mode
:hook
(terraform-mode . siren-terraform-mode-setup)
:custom
(terraform-indent-level 2)
:preface
(defun siren-terraform-mode-setup ()
(setq-local tab-width 2))
:config
;; This does a better job of injecting formatted content than the default
;; formatting commands included with terraform-mode.
(reformatter-define terraform-format
:program "terraform"
:args '("fmt" "-no-color" "-")
:lighter " fmt"))
(use-package lsp-terraform
:straight lsp-mode
:hook
(terraform-mode . siren-lsp-terraform-mode-setup)
:preface
(defun siren-lsp-terraform-mode-setup ()
;; Disable semantic tokens as it typically causes an annoying delay with the
;; syntax highlighting as you type. Essentially all new text is a very faded
;; out grey color for the first 1-2 seconds as you type.
(setq-local lsp-semantic-tokens-enable nil)
(lsp-format-buffer-on-save-mode t)
(lsp-deferred)))
(use-package terraform-doc
:defer t)
(provide 'siren-terraform)
;;; siren-terraform.el ends here