emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 860 forks source link

Support always showing signatures (implementation ready) #4128

Open djr7C4 opened 11 months ago

djr7C4 commented 11 months ago

Is your feature related or already mentioned on the wishlist?

No.

Currently, lsp-mode supports showing signatures via eldoc when a trigger character is pressed. For most servers, signatures are triggered after a parentheses is entered.

I prefer to always have signatures always displayed when available regardless of the last character typed. This is the behavior I get with eldoc by default in other modes that do not use lsp-mode such as emacs-lisp-mode.

I have patched my local lsp-mode installation to implement this behavior when lsp-signature-auto-activate is t while retaining the standard behavior when it is a list that contains :on-trigger-char. This is part of the default value and is also included when it is toggled with lsp-toggle-signature-auto-activate.

If there is interest in this feature please let me know and I will submit a pull request.

bigodel commented 2 months ago

I have patched my local lsp-mode installation to implement this behavior when lsp-signature-auto-activate is t while retaining the standard behavior when it is a list that contains :on-trigger-char. This is part of the default value and is also included when it is toggled with lsp-toggle-signature-auto-activate.

i was trying to achieve the same thing, can you provide the code you used?