lsp-haskell icon indicating copy to clipboard operation
lsp-haskell copied to clipboard

Headscratching class plugin experience

Open hellwolf opened this issue 2 years ago • 8 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: https://github.com/haskell/haskell-language-server/discussions/3105

I am curious how you all think of this.

Cheers,

hellwolf avatar Aug 15 '22 13:08 hellwolf

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

yyoncho avatar Aug 15 '22 14:08 yyoncho

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

hellwolf avatar Aug 15 '22 14:08 hellwolf

actually

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

didn't work :(

hellwolf avatar Aug 15 '22 14:08 hellwolf

set lsp-lens-enable to nil

yyoncho avatar Aug 15 '22 14:08 yyoncho

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

hellwolf avatar Aug 15 '22 15:08 hellwolf

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

hellwolf avatar Aug 15 '22 16:08 hellwolf

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!

michaelpj avatar Aug 15 '22 20:08 michaelpj

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

hellwolf avatar Aug 22 '22 19:08 hellwolf

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

michaelpj avatar Aug 24 '23 08:08 michaelpj