Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions modules/tools/terraform/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@
:after terraform-mode
:config
(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: "))))))
4 changes: 4 additions & 0 deletions modules/tools/terraform/doctor.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

(unless (executable-find "terraform")
(warn! "Couldn't find terraform."))

(when (modulep! +lsp)
(unless (executable-find "terraform-docs")
(warn! "Couldn't find terraform-docs")))
5 changes: 5 additions & 0 deletions modules/tools/terraform/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
(package! terraform-mode :pin "abfc10f5e313c4bb99de136a14636e9bc6df74f6")
(when (modulep! :completion company)
(package! company-terraform :pin "8d5a16d1bbeeb18ca49a8fd57b5d8cd30c8b8dc7"))

(when (modulep! +docs)
(package! terraform-docs
:recipe (:host github :repo "loispostula/terraform-docs.el" :branch "main")
:pin "94a78999ec03e66ce49f7343cc8705354e195c3a"))