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

Make lsp-ui less noisy #494

Open sebastiencs opened 3 years ago

sebastiencs commented 3 years ago

Based on this comment

the overall feedback on lsp-ui-doc being too noisy

What can we do to make lsp-ui less noisy ?

I am thinking of:

Other ideas ?

cc @emacs-lsp/lsp-mode

CsBigDataHub commented 3 years ago

@sebastiencs @yyoncho

FYI 17f015e11f7eaa4c1d5f190b16c9b0c5a1df48ec is giving lsp-ui-doc--move-frame: Wrong type argument: number-or-marker-p, nil error

sebastiencs commented 3 years ago

@CsBigDataHub Please open an issue for this with the full backtrace [M-x] toggle-debug-on-error

yyoncho commented 3 years ago

I think it is not about making lsp-ui less noisy. A lot of people prefer lsp-ui the way that it is and even more, lsp-ui is kind of lsp-mode's killer feature for them. I think that there are a lot of people in emacs community who are looking for clean UI with no noise at all and no matter how much we decrease the "noisiness" of lsp-ui they will be still unhappy by the fact that lsp-mode has enabled it by default.

The more I think about that, the more I think that we should not enable lsp-ui by default in lsp-mode auto-configuration. This idea was rejected by voting in the past but maybe we have to revisit that decision.

  • Make lsp-ui-sideline show only a single light bulb for all code actions, and not showing the title of all actions available

IMO this should be implemented in lsp-mode as alternative of modeline code actions, at least I don't see a reason to have it in lsp-ui.

One more thing that I am working on in lsp-ide: create a configuration which has most common configuration properties with nice default value + comments what are the alternatives. That configuration might have disabled sections(e. g. enable if you prefer FOO-BAR)

kiennq commented 3 years ago

To make sure my understanding is correct, I don't think lsp-mode depends on lsp-ui and only enable lsp-ui if it's enabled. Is that correct? In that case, if user don't want lsp-ui, the best way is not install it instead of not enabling it when auto-configuring lsp-mode. We can stretch this clearer on the document of noisiness of lsp-ui.

On other hand, I think it's good to reduce lsp-ui noisiness, especially lsp-ui-sideline. Sometimes I found it overwhelming and just turn it off. We can probably make it as @sebastiencs propose to only show hover information for symbol at point instead of all symbols, and allow an option to do otherwise.

For

  • Make lsp-ui-sideline show only a single light bulb for all code actions, and not showing the title of all actions available

IMO this should be implemented in lsp-mode as alternative of modeline code actions, at least I don't see a reason to have it in lsp-ui.

I think it should be in lsp-ui-sideline as it's rendered there. We can share the logic for creating the string/light bub from lsp-mode to lsp-ui. From my perspective, lsp-mode shouldn't contains advance UI logic (child frame, xwidget ...) but only the text-based one, thus allow it to usable even inside terminal. The advance UI logic should be left in lsp-ui, both for easiness of code maintenance and user expectation. Well, I think that's the reason why lsp-ui is being created in the first place, isn't it?

yyoncho commented 3 years ago

In that case, if user don't want lsp-ui, the best way is not install it instead of not enabling it when auto-configuring lsp-mode. We can stretch this clearer on the document of noisiness of lsp-ui.

Yes, but this is not what is happening. lsp-ui is mentioned as an optional component but users are mechanically copying the section and then they complain that it is enabled ...