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.81k stars 893 forks source link

lsp broken by macro expansion failure and docs-link vs docs_link discrepancy #4222

Closed dod38fr closed 1 year ago

dod38fr commented 1 year ago

Thank you for the bug report

Bug description

Hi

On startup, emacs shows the following error message:

Beginning of buffer [3 times]
File mode specification error: (error Eager macro-expansion failure: (error "Unknown key: :docs-link.  Available keys: (:name :docs_link :version :source_type :dependent_modules)")) [2 times]
Mark set

This breaks lsp-mode for terraform-mode and go-mode. The latter is weird because lsp-terraform is the only mode dealing with docs_link (with underscore).

These modules are loaded with:

(use-package lsp-mode
  :ensure t
   ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
  :init (setq lsp-keymap-prefix "C-c l")
  :hook (
         (terraform-mode . lsp)
         (go-mode . lsp)
         (python-mode . lsp) )
  :commands lsp)

Steps to reproduce

This error happens when loading lsp-mode

Expected behavior

No error when loading lsp-mode

Which Language Server did you use?

OS

Linux

Error callstack

call stack:

Debugger entered--Lisp error: (error "Eager macro-expansion failure: (error \"Unknown key...")
  error("Eager macro-expansion failure: %S" (error "Unknown key: :docs-link.  Available keys: (:name :..."))
  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/domi/.emacs.d/elpa/lsp-mode-20231103.1522/ls..." "/home/domi/.emacs.d/elpa/lsp-mode-20231103.1522/ls..." t t)
  require(lsp-terraform nil t)
  (if (featurep package) nil (require package nil t))
  (closure (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 dap-auto-configure-mode t) (package) (if (featurep package) nil (require package nil t)))(lsp-terraform)
  mapc((closure (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 dap-auto-configure-mode t) (package) (if (featurep package) nil (require package nil t))) (ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-awk lsp-astro lsp-bash lsp-beancount lsp-clangd lsp-clojure lsp-cmake lsp-credo lsp-crystal lsp-csharp lsp-css lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile lsp-elm lsp-elixir lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-go lsp-gleam lsp-glsl lsp-graphql lsp-hack lsp-grammarly lsp-groovy lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript lsp-json lsp-kotlin lsp-latex lsp-ltex lsp-lua lsp-markdown lsp-marksman lsp-mdx lsp-mint ...))
  seq-do((closure (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 dap-auto-configure-mode t) (package) (if (featurep package) nil (require package nil t))) (ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-awk lsp-astro lsp-bash lsp-beancount lsp-clangd lsp-clojure lsp-cmake lsp-credo lsp-crystal lsp-csharp lsp-css lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile lsp-elm lsp-elixir lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-go lsp-gleam lsp-glsl lsp-graphql lsp-hack lsp-grammarly lsp-groovy lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript lsp-json lsp-kotlin lsp-latex lsp-ltex lsp-lua lsp-markdown lsp-marksman lsp-mdx lsp-mint ...))
  (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()
  lsp()
  (progn (lsp))
  (if (and lsp-mode (not lsp--buffer-workspaces)) (progn (lsp)))
  (let ((last-message (current-message))) (setq lsp-mode (cond ((eq arg 'toggle) (not lsp-mode)) ((and (numberp arg) (< arg 1)) nil) (t t))) (if (boundp 'local-minor-modes) (progn (setq local-minor-modes (delq 'lsp-mode local-minor-modes)) (if lsp-mode (progn (setq local-minor-modes (cons 'lsp-mode local-minor-modes)))))) (if (and lsp-mode (not lsp--buffer-workspaces)) (progn (lsp))) (run-hooks 'lsp-mode-hook (if lsp-mode 'lsp-mode-on-hook 'lsp-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local " in current buffer")) (message "%s %sabled%s" "Lsp mode" (if lsp-mode "en" "dis") local))))))
  lsp-mode(toggle)
  funcall-interactively(lsp-mode toggle)
  command-execute(lsp-mode record)
  (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name))
  (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history 'extended-command-history command-name))) (signal (car err) (cdr err))))
  (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) (command-name (symbol-name command))) (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history 'extended-command-history command-name))) (signal (car err) (cdr err)))))
  (progn (progn (setq this-command command) (setq real-this-command command)) (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) (command-name (symbol-name command))) (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history 'extended-command-history command-name))) (signal (car err) (cdr err))))))
  (if command (progn (progn (setq this-command command) (setq real-this-command command)) (let ((prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) (command-name (symbol-name command))) (condition-case err (progn (command-execute command 'record) (add-to-history 'extended-command-history command-name)) ((debug error) (if helm-M-x-always-save-history (progn (add-to-history ... command-name))) (signal (car err) (cdr err)))))))
  helm-M-x-execute-command(lsp-mode)
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  helm-internal((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x5393709d9c01c77>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (f12 . #f(compiled-function () ... #<bytecode 0x1980282e286280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1980282e185280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1980282e194280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1980282e2d3280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1980282e2c2280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1980282e2a1280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1980282e2b0280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1980282e2ef280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1980282e2fe280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1980282e23d280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1980282e22c280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1980282e20b280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode -0x5393709d9c01c77>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (f12 . #f(compiled-function () ... #<bytecode 0x1980282e286280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1980282e185280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1980282e194280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1980282e2d3280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1980282e2c2280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1980282e2a1280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1980282e2b0280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1980282e2ef280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1980282e2fe280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1980282e23d280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1980282e22c280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1980282e20b280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  helm((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x5393709d9c01c77>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (f12 . #f(compiled-function () ... #<bytecode 0x1980282e286280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1980282e185280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1980282e194280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1980282e2d3280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1980282e2c2280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1980282e2a1280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1980282e2b0280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1980282e2ef280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1980282e2fe280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1980282e23d280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1980282e22c280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1980282e20b280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode -0x5393709d9c01c77>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (f12 . #f(compiled-function () ... #<bytecode 0x1980282e286280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1980282e185280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1980282e194280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1980282e2d3280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1980282e2c2280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1980282e2a1280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1980282e2b0280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1980282e2ef280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1980282e2fe280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1980282e23d280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1980282e22c280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1980282e20b280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  helm(:sources (((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x5393709d9c01c77>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (f12 . #f(compiled-function () ... #<bytecode 0x1980282e286280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1980282e185280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1980282e194280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1980282e2d3280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1980282e2c2280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1980282e2a1280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1980282e2b0280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1980282e2ef280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1980282e2fe280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1980282e23d280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1980282e22c280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1980282e20b280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates ... pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode -0x5393709d9c01c77>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (f12 . #f(compiled-function () ... #<bytecode 0x1980282e286280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1980282e185280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1980282e194280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1980282e2d3280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1980282e2c2280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1980282e2a1280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1980282e2b0280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1980282e2ef280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1980282e2fe280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1980282e23d280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1980282e22c280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1980282e20b280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort (closure ... ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("C-j: Describe this command (keep..." 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data closure (... ...) nil (helm-comp-read-get-candidates collection pred nil nil "")) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) :prompt "M-x " :buffer "*helm M-x*" :history helm-M-x-input-history :truncate-lines t)
  (progn (setq current-prefix-arg nil) (helm :sources sources :prompt prompt :buffer "*helm M-x*" :history 'helm-M-x-input-history :truncate-lines t))
  (unwind-protect (progn (setq current-prefix-arg nil) (helm :sources sources :prompt prompt :buffer "*helm M-x*" :history 'helm-M-x-input-history :truncate-lines t)) (helm-M-x--unwind-forms))
  (let* ((pred (or predicate #'commandp)) (helm-fuzzy-sort-fn #'(lambda (candidates _source) (helm-fuzzy-matching-default-sort-fn-1 candidates t))) (sources (list (helm-make-source "Emacs Commands history" 'helm-M-x-class :data #'(lambda nil (helm-comp-read-get-candidates ... pred nil nil "")) :fuzzy-match helm-M-x-fuzzy-match) (helm-make-source "Emacs Commands" 'helm-M-x-class :data #'(lambda nil (helm-comp-read-get-candidates collection pred nil nil "")) :fuzzy-match helm-M-x-fuzzy-match))) (prompt (concat (cond ((eq helm-M-x-prefix-argument '-) "- ") ((and (consp helm-M-x-prefix-argument) (eq ... 4)) "C-u ") ((and (consp helm-M-x-prefix-argument) (integerp ...)) (format "%d " (car helm-M-x-prefix-argument))) ((integerp helm-M-x-prefix-argument) (format "%d " helm-M-x-prefix-argument))) "M-x "))) (setq helm-M-x--timer (run-at-time 1 0.1 #'helm-M-x--notify-prefix-arg)) (add-hook 'helm-move-selection-after-hook #'helm-M-x--move-selection-after-hook) (add-hook 'helm-before-action-hook #'helm-M-x--before-action-hook) (if (and sources helm-M-x-reverse-history) (progn (setq sources (nreverse sources)))) (unwind-protect (progn (setq current-prefix-arg nil) (helm :sources sources :prompt prompt :buffer "*helm M-x*" :history 'helm-M-x-input-history :truncate-lines t)) (helm-M-x--unwind-forms)))
  helm-M-x-read-extended-command([0 lsp-erlang-ls-server-start-fun flycheck-list-errors lsp:omnisharp-run-tests-in-class-request-column tramp-sudoedit-file-name-handler lsp-pwsh-help-completion Set\ Slice lsp-watch-kind? speedbar-check-vc-this-line Reduce\ To:\ to\ Cc: :maxLength c-electric-lt-gt lsp-rust-analyzer-injected-modifier-face c-state-min-scan-pos ff-all-dirs-under &error flycheck-mode-line-prefix cl-struct-flycheck-syntax-check-tags gnus-mime-security-details-buffer eslint-tramp org-table--descriptor-line edebug-mode-on-hook message-expand-name-databases :EndLineNumber 0 tree-widget-button-keymap gnus-try-warping-via-registry kotlin-language-server :where *table--cell-kill-paragraph :odt-styles-file flycheck-pug-executable lsp-elixir-suggest-specs org-table-get-range buf-list WatchKind lsp:set-rename-params-uri? lsp-pyls-plugins-flake8-hang-closing lsp-pylsp-plugins-rope-completion-enabled lsp--virtual-buffer lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-brackets lsp-lua-hint-enable dash-expand:&JSONResponse? smime-buffer-as-string-region no-truncate lsp-inlay-hint-face org-at-keyword-p lsp-rust-analyzer-trait-modifier bibtex-text-in-string ! ...])
  (if (or defining-kbd-macro executing-kbd-macro) (helm-M-x--vanilla-M-x) (helm-M-x-read-extended-command obarray))
  helm-M-x(nil)
  funcall-interactively(helm-M-x nil)
  command-execute(helm-M-x)

This call stack comes from enabling lsp-mode in a buffer using go-mode.



### Anything else?

_No response_
dod38fr commented 1 year ago

This is related to https://github.com/emacs-lsp/lsp-mode/issues/3738

dod38fr commented 1 year ago

My bad, this issue comes from the way lsp-mode is loaded. Loading lsp-mode the following way fixes my setup:

(require 'lsp-mode)
(add-hook 'terraform-mode #'lsp)
(add-hook 'go-mode #'lsp)
(add-hook 'python-mode #'lsp)
shackra commented 11 months ago

This is affecting me on Doom Emacs, I'm not doing anything like @dod38fr

Balooga commented 10 months ago

Like @shackra, I also use Doom Emacs and can confirm this is an issue.