This commit is contained in:
Loïs Postula 2025-12-03 09:54:58 +00:00 committed by GitHub
commit dba188b0a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View file

@ -32,3 +32,16 @@
:after terraform-mode :after terraform-mode
:config :config
(set-company-backend! 'terraform-mode 'company-terraform)) (set-company-backend! 'terraform-mode 'company-terraform))
(use-package! terraform-docs
:when (modulep! +docs)
:defer t
:after terraform-mode
:config
(map! :map terraform-mode-map
:localleader
:desc "docs" "d" #'terraform-docs
(:prefix ("D" . "docs submenu")
:desc "to buffer" "D" #'terraform-docs-to-buffer
:desc "to file" "d" (cmd! (terraform-docs-to-file nil (read-file-name "Output file: ")))
:desc "to file and open" "o" (cmd! (terraform-docs-to-file-and-open nil (read-file-name "Output file: "))))))

View file

@ -2,3 +2,7 @@
(unless (executable-find "terraform") (unless (executable-find "terraform")
(warn! "Couldn't find terraform.")) (warn! "Couldn't find terraform."))
(when (modulep! +lsp)
(unless (executable-find "terraform-docs")
(warn! "Couldn't find terraform-docs")))

View file

@ -4,3 +4,8 @@
(package! terraform-mode :pin "01635df3625c0cec2bb4613a6f920b8569d41009") (package! terraform-mode :pin "01635df3625c0cec2bb4613a6f920b8569d41009")
(when (modulep! :completion company) (when (modulep! :completion company)
(package! company-terraform :pin "8d5a16d1bbeeb18ca49a8fd57b5d8cd30c8b8dc7")) (package! company-terraform :pin "8d5a16d1bbeeb18ca49a8fd57b5d8cd30c8b8dc7"))
(when (modulep! +docs)
(package! terraform-docs
:recipe (:host github :repo "loispostula/terraform-docs.el" :branch "main")
:pin "94a78999ec03e66ce49f7343cc8705354e195c3a"))