Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yas-minor-mode cannot hook after lsp-mode if re-bind lsp-keymap-prefix #3184

Open
3 tasks done
ccqpein opened this issue Nov 3, 2021 · 1 comment
Open
3 tasks done
Labels

Comments

@ccqpein
Copy link
Contributor

ccqpein commented Nov 3, 2021

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command
emacs -q -l lsp-start-plain.el

where lsp-start-plain.el can be downloaded here.

Bug description

My lsp-mode configuration is

(use-package lsp-mode
  :hook
  (;; for yas
   (lsp-mode . yas-minor-mode)

   ;; for change prefix keys
   ;; get from this issue https://github.com/emacs-lsp/lsp-mode/issues/1532
   (lsp-mode . (lambda ()
                 (let ((lsp-keymap-prefix "C-c l"))
                   (lsp-enable-which-key-integration))))
   )

  :commands (lsp lsp-deferred))

Then after I open my rust project, lsp-mode load fine but yas hasn't loaded.

If I change config to

(use-package lsp-mode
  :hook
  (;; for yas
   (lsp-mode . yas-minor-mode)

   ;; for change prefix keys
   ;; get from this issue https://github.com/emacs-lsp/lsp-mode/issues/1532
   ;;(lsp-mode . (lambda ()
   ;;              (let ((lsp-keymap-prefix "C-c l"))
   ;;                (lsp-enable-which-key-integration))))
   )

  :commands (lsp lsp-deferred))

Yas loaded well.

Steps to reproduce

Just as the config in bug description.

Expected behavior

Expect yas mode load after lsp-mode load.

Which Language Server did you use?

rust-analyzer

OS

MacOS

Error callstack

No response

Anything else?

before today, I use :init (setq lsp-keymap-prefix "C-c l") to set lsp-keymap-prefix, but it doesn't work anymore. So I found #1532 and make the change as the config I post upper. lsp-keymap-prefix works fine now, but then the yas doesn't load.

@ccqpein ccqpein added the bug label Nov 3, 2021
@ccqpein
Copy link
Contributor Author

ccqpein commented Nov 3, 2021

Arrive my expectation with:

(use-package lsp-mode
  :init
  (setq lsp-keymap-prefix "C-c l")

  :hook
  (;; for yas
   (lsp-mode . yas-minor-mode)
   )

  :commands (lsp lsp-deferred)

  :bind
  (:map lsp-mode-map
        ("C-c l g d" . lsp-find-definition) ;; I like d => definition rather than g
        )

  :config
  (define-key lsp-mode-map (kbd "C-c l") lsp-command-map))

Still don't know why the hook config upper doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant