Skip to content

Commit

Permalink
lsp-terraform: migrate code
Browse files Browse the repository at this point in the history
  • Loading branch information
daedric committed Sep 19, 2023
1 parent 1f5afbd commit dcfe2bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/lsp-terraform.el
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,23 @@ This is a synchronous action."
:installed-version installed-version
:version-constraint (lsp-get provider :version_constraint)))

(lsp-defun construct-tf-module ((&terraform-ls:Module :name :docs-link :version :source-type :dependent-modules))
(lsp-defun construct-tf-module ((&terraform-ls:Module :name :docs_link :version :source_type :dependent_modules))
"Construct `TF-MODULE' using MODULE."
(make-tf-module :name name
:doc-link docs-link
:version version
:source-type source-type
:dependent-modules dependent-modules))

(lsp-defun lsp-terraform-ls--providers-to-tf-package ((&terraform-ls:Providers :provider-requirements :installed-providers))
(lsp-defun lsp-terraform-ls--providers-to-tf-package ((&terraform-ls:Providers :provider_requirements :installed_providers))
"Convert PROVIDERS-TREE-DATA to list of `tf-package'."
(let* ((provider-requirements-keys (hash-table-keys provider-requirements))
(installed-versions (mapcar (lambda (x) (lsp-get installed-providers (make-symbol (format ":%s" x)))) provider-requirements-keys))
(providers (mapcar (lambda (x) (lsp-get provider-requirements (make-symbol (format ":%s" x)))) provider-requirements-keys))
(tf-packages (-zip-with (lambda (x y) (construct-tf-package x y)) providers installed-versions)))
tf-packages))

(lsp-defun lsp-terraform-ls--modules-to-tf-module ((&terraform-ls:ModuleCalls :module-calls))
(lsp-defun lsp-terraform-ls--modules-to-tf-module ((&terraform-ls:ModuleCalls :module_calls))
"Convert MODULES-TREE-DATA to list of `TF-MODULE'."
(let* ((modules (-map (lambda (x) (construct-tf-module x)) module-calls)))
modules))
Expand Down

0 comments on commit dcfe2bd

Please sign in to comment.