emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 860 forks source link

Crash when using doom emacs with lsp-mode in terraform-client #4480

Closed Gleydar closed 1 week ago

Gleydar commented 1 week ago

Thank you for the bug report

Bug description

When using Doom emacs with lsp-mode enabled, there seems to be an issue with lsp-terraform. I don't know, however, if this is an issue with lsp-mode or its interaction with Doom emacs

Steps to reproduce

Expected behavior

LSP mode starts up and works normally

Which Language Server did you use?

lsp-clang, lsp-gopls

OS

Linux

Error callstack

Debugger entered--Lisp error: (error "Eager macro-expansion failure: (error \"Unknown key: :docs_link.  Available keys: (:name :docs-link :version :source-type :dependent-modules)\")")
  error("Eager macro-expansion failure: %S" (error "Unknown key: :docs_link.  Available keys: (:name :docs-link :version :source-type :dependent-modules)"))
  internal-macroexpand-for-load((defalias 'construct-tf-module #'(lambda (input0) "Construct `TF-MODULE' using MODULE." (-let* (((&terraform-ls:Module :name :docs_link :version :source_type :dependent_modules) input0)) (make-tf-module :name name :doc-link docs_link :version version :source-type source_type :dependent-modules dependent_modules)))) t)
  load-with-code-conversion("/home/kosch/.config/emacs/.local/straight/build-29.3/lsp-mode/lsp-terraform.el" "/home/kosch/.config/emacs/.local/straight/build-29.3/lsp-mode/lsp-terraform.el" t t)
  require(lsp-terraform nil t)
  (if (featurep package) nil (require package nil t))
  (closure (tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (package) (if (featurep package) nil (require package nil t)))(lsp-terraform)
  mapc((closure (tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (package) (if (featurep package) nil (require package nil t))) (ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-asm lsp-astro lsp-autotools lsp-awk lsp-bash lsp-beancount lsp-bufls lsp-clangd lsp-clojure lsp-cmake lsp-cobol lsp-credo lsp-crystal lsp-csharp lsp-css lsp-cucumber lsp-cypher lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile lsp-earthly lsp-elixir lsp-elm lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly lsp-graphql lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript lsp-jq ...))
  seq-do((closure (tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (package) (if (featurep package) nil (require package nil t))) (ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-asm lsp-astro lsp-autotools lsp-awk lsp-bash lsp-beancount lsp-bufls lsp-clangd lsp-clojure lsp-cmake lsp-cobol lsp-credo lsp-crystal lsp-csharp lsp-css lsp-cucumber lsp-cypher lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile lsp-earthly lsp-elixir lsp-elm lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly lsp-graphql lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript lsp-jq ...))
  (progn (seq-do #'(lambda (package) (if (featurep package) nil (require package nil t))) lsp-client-packages) (setq lsp--client-packages-required t))
  (if (and lsp-auto-configure (not lsp--client-packages-required)) (progn (seq-do #'(lambda (package) (if (featurep package) nil (require package nil t))) lsp-client-packages) (setq lsp--client-packages-required t)))
  lsp--require-packages()
  (closure (lsp-browser-mode-abbrev-table lsp-browser-mode-syntax-table lsp-log-io-mode-abbrev-table lsp-log-io-mode-syntax-table tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (&optional arg) "Entry point for the server startup.\nWhen ARG is t ..." (interactive "P") (lsp--require-packages) (if (buffer-file-name) (progn (let (clients (matching-clients (lsp--filter-clients (-andfn ... ...)))) (cond (matching-clients (if (setq lsp--buffer-workspaces ...) (progn ... ... ... ...))) ((setq clients (lsp--filter-clients ...)) (lsp--info "There are language server(%s) installation in prog..." (-map ... clients)) (seq-do #'... clients)) ((setq clients (lsp--filter-clients ...)) (let (...) (progn ... ...) (lsp--install-server-internal client))) ((not lsp-warn-no-matched-clients) nil) ((setq clients (if matching-clients nil ...)) (lsp--warn "The following servers support current file but aut..." (mapconcat ... clients " "))) ((setq clients (if matching-clients nil ...)) (lsp--warn "The following servers support current file but do ..." (mapconcat ... clients " "))) ((not (lsp--filter-clients ...)) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode)))))))()
  apply((closure (lsp-browser-mode-abbrev-table lsp-browser-mode-syntax-table lsp-log-io-mode-abbrev-table lsp-log-io-mode-syntax-table tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (&optional arg) "Entry point for the server startup.\nWhen ARG is t ..." (interactive "P") (lsp--require-packages) (if (buffer-file-name) (progn (let (clients (matching-clients (lsp--filter-clients ...))) (cond (matching-clients (if ... ...)) ((setq clients ...) (lsp--info "There are language server(%s) installation in prog..." ...) (seq-do ... clients)) ((setq clients ...) (let ... ... ...)) ((not lsp-warn-no-matched-clients) nil) ((setq clients ...) (lsp--warn "The following servers support current file but aut..." ...)) ((setq clients ...) (lsp--warn "The following servers support current file but do ..." ...)) ((not ...) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode))))))) nil)
  (if magit-buffer-revision nil (apply fn args))
  magit--lsp--disable-when-visiting-blob((closure (lsp-browser-mode-abbrev-table lsp-browser-mode-syntax-table lsp-log-io-mode-abbrev-table lsp-log-io-mode-syntax-table tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (&optional arg) "Entry point for the server startup.\nWhen ARG is t ..." (interactive "P") (lsp--require-packages) (if (buffer-file-name) (progn (let (clients (matching-clients (lsp--filter-clients ...))) (cond (matching-clients (if ... ...)) ((setq clients ...) (lsp--info "There are language server(%s) installation in prog..." ...) (seq-do ... clients)) ((setq clients ...) (let ... ... ...)) ((not lsp-warn-no-matched-clients) nil) ((setq clients ...) (lsp--warn "The following servers support current file but aut..." ...)) ((setq clients ...) (lsp--warn "The following servers support current file but do ..." ...)) ((not ...) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode))))))))
  apply(magit--lsp--disable-when-visiting-blob (closure (lsp-browser-mode-abbrev-table lsp-browser-mode-syntax-table lsp-log-io-mode-abbrev-table lsp-log-io-mode-syntax-table tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options view-inhibit-help-message lsp-help-mode-abbrev-table lsp-help-mode-syntax-table eldoc-documentation-default cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines dap-ui-menu-items t) (&optional arg) "Entry point for the server startup.\nWhen ARG is t ..." (interactive "P") (lsp--require-packages) (if (buffer-file-name) (progn (let (clients (matching-clients (lsp--filter-clients ...))) (cond (matching-clients (if ... ...)) ((setq clients ...) (lsp--info "There are language server(%s) installation in prog..." ...) (seq-do ... clients)) ((setq clients ...) (let ... ... ...)) ((not lsp-warn-no-matched-clients) nil) ((setq clients ...) (lsp--warn "The following servers support current file but aut..." ...)) ((setq clients ...) (lsp--warn "The following servers support current file but do ..." ...)) ((not ...) (lsp--error "There are no language servers supporting current m..." major-mode major-mode major-mode))))))) nil)
  lsp()
  (progn (remove-hook 'window-configuration-change-hook #'lsp--init-if-visible t) (lsp) t)
  (if (lsp--buffer-visible-p) (progn (remove-hook 'window-configuration-change-hook #'lsp--init-if-visible t) (lsp) t))
  lsp--init-if-visible()
  (if (lsp--init-if-visible) nil (add-hook 'window-configuration-change-hook #'lsp--init-if-visible nil t))
  (save-current-buffer (set-buffer buffer) (if (lsp--init-if-visible) nil (add-hook 'window-configuration-change-hook #'lsp--init-if-visible nil t)))
  (progn (save-current-buffer (set-buffer buffer) (if (lsp--init-if-visible) nil (add-hook 'window-configuration-change-hook #'lsp--init-if-visible nil t))))
  (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer) (if (lsp--init-if-visible) nil (add-hook 'window-configuration-change-hook #'lsp--init-if-visible nil t)))))
  (closure ((buffer . #<buffer handle_usage.c>)) nil (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer) (if (lsp--init-if-visible) nil (add-hook 'window-configuration-change-hook #'lsp--init-if-visible nil t))))))()
  apply((closure ((buffer . #<buffer handle_usage.c>)) nil (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer) (if (lsp--init-if-visible) nil (add-hook 'window-configuration-change-hook #'lsp--init-if-visible nil t)))))) nil)
  timer-event-handler([t 0 0 0 nil (closure ((buffer . #<buffer handle_usage.c>)) nil (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer) (if (lsp--init-if-visible) nil (add-hook ... ... nil t)))))) nil idle 0 nil])


### Anything else?

_No response_