emacs-lsp / lsp-haskell

lsp-mode :heart: haskell
https://emacs-lsp.github.io/lsp-haskell
GNU General Public License v3.0
233 stars 63 forks source link

Headscratching class plugin experience #153

Closed hellwolf closed 1 year ago

hellwolf commented 2 years ago

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: https://github.com/haskell/haskell-language-server/discussions/3105

I am curious how you all think of this.

Cheers,

yyoncho commented 2 years ago

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

hellwolf commented 2 years ago

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

hellwolf commented 2 years ago

actually

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

didn't work :(

yyoncho commented 2 years ago

set lsp-lens-enable to nil

hellwolf commented 2 years ago

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

hellwolf commented 2 years ago

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

michaelpj commented 2 years ago

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!

hellwolf commented 2 years ago

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" :)

michaelpj commented 1 year ago

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