emacs-lsp/lsp-haskell

Headscratching class plugin experience

Closed this issue · 9 comments

Hi,

I have enjoyed using lsp-mode a lot, been a treat!

A recent update of lsp "master" branch code had me a bit head scratching, and resulted me to disable it for now:

(use-package lsp-haskell
  :config
  (add-hook 'lsp-after-initialize-hook
            #'(lambda ()
                (lsp--set-configuration
                 `(:haskell (:plugin (:class (:codeLensOn 0))))
                 ))))

The behavior is that the instance signature codeLens clutters my source code, and often I mis-click some and then it modifies the code for me:

image

Related discussion at: haskell/haskell-language-server#3105

I am curious how you all think of this.

Cheers,

The question is whether we can do better or you just like it off.

I'd definitely prefer the default setting that means having it on.

actually

(use-package lsp-haskell
  :config
  (add-hook 'lsp-after-initialize-hook
            #'(lambda ()
                (lsp--set-configuration
                 `(:haskell (:plugin (:class (:codeLensOn ,nil))))
                 ))))

didn't work :(

set lsp-lens-enable to nil

Ah, but I only want to disable the codeLens for the "class" plugin for now.

I think make them only expand only when clicked with a modifier key pressed could be an option?

Looking at the HLS issue, it seems that there already is an option, we just don't expose it in lsp-haskell. Unfortunately, we have to manually regenerate the defcustoms for all the options as new ones are added, so it just needs someone to do the work. PRs welcome!

we have to manually regenerate the defcustoms for all the options as new ones are added, so it just needs someone to do the work. PRs welcome!

I wouldn't mind doing the PR, but I don't know how to generate, is it using:

https://github.com/emacs-lsp/lsp-mode/blob/master/scripts/lsp-generate-settings.el

Though I'd still prefer not to disable the feature if it gets a better "UX" :)

We updated the config, so this should be configurable now.