emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

setting lsp-ui-sideline-show-code-actions does not change its value #736

Closed uliw closed 1 year ago

uliw commented 1 year ago

setting (setq lsp-ui-sideline-show-code-actions t) in my init file has no effect. Once an lsp session is started, the value reverses back to nil.

Setting it after the session has loaded works as expected. I use the following init code

(use-package lsp-mode
 :ensure t
  :init
  (add-to-list 'company-backends 'company-capf)
  )
(use-package lsp-grammarly
  :ensure t
  )
(add-to-list 'lsp-language-id-configuration '(org-mode . "org-mode"))
(use-package lsp-ui
  :ensure t)
(setq lsp-ui-sideline-enable t)
(setq lsp-ui-sideline-show-code-actions t)
gf3 commented 1 year ago

i am experiencing a similar issue with the following config:

(use-package lsp-mode
  :straight t
  :init
  (setq lsp-keymap-prefix "s-l")
  :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
         (go-mode . lsp-deferred)
         ;; if you want which-key integration
         (lsp-mode . lsp-enable-which-key-integration))
  :commands (lsp lsp-deferred))

(use-package lsp-ui
  :straight t
  :config
  (setq lsp-ui-doc-border "systemYellowColor")
  (setq lsp-ui-doc-border (face-foreground 'default))
  (setq lsp-ui-doc-enable t)
  (setq lsp-ui-doc-header t)
  (setq lsp-ui-doc-include-signature t)
  (setq lsp-ui-doc-position 'at-point)
  (setq lsp-ui-doc-show-with-cursor t)
  (setq lsp-ui-doc-show-with-mouse nil)
  (setq lsp-ui-doc-use-webkit t)
  (setq lsp-ui-flycheck-enable t)
  (setq lsp-ui-flycheck-list-position 'right)
  (setq lsp-ui-flycheck-live-reporting t)
  (setq lsp-ui-peek-enable t)
  (setq lsp-ui-sideline-actions-icon lsp-ui-sideline-actions-icon-default)
  (setq lsp-ui-sideline-enable t)
  (setq lsp-ui-sideline-ignore-duplicate t)
  (setq lsp-ui-sideline-show-code-actions t)
  (setq lsp-ui-sideline-show-diagnostics t)
  (setq lsp-ui-sideline-show-hover t)
  :custom-face
  (lsp-ui-doc-background ((t (:background nil))))
  (lsp-ui-doc-header ((t (:inherit (font-lock-string-face italic)))))
  :bind (:map lsp-ui-mode-map
              ([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
              ([remap xref-find-references] . lsp-ui-peek-find-references))
  :hook (lsp-mode . lsp-ui-mode)
  :commands (lsp-ui-mode)
  :after lsp)

most of my lsp-ui config is reverted/overwritten/ignored when an lsp session is actually started

uliw commented 1 year ago

This was caused by a configuration error in my init file. It works just fine with a vanilla setup