-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove never mind from prompt. #386
Remove never mind from prompt. #386
Conversation
I'm not sure what was the original intent, but if there's only one code action, the current implementation allows the user to cancel applying the code action by selecting "never mind". On the other hand, if I remember correctly, the tmm menu is not shown if there's only one candidate, and therefore it is not possible to press C-g. |
Yes, I'd like hard proof that the "never mind..." isn't doing anything there. I admit I cannot remeber why I added it (maybe |
I’ll look into it a little more! While I’m here - would an acceptable solution be skipping tmm altogether and use something like completing-read? It would then supply options to ivy, helm, Ido etc. Now I get ivy completion when I press tab after tmm prompt is shown, but entering something there would just enter value into minibuffer, not execute choice |
It looks like never-mind was added to the initial commit of that function, so I cannot find any clues there. My humble guess is that this value is there for mouse clicking. I don't think you can cancel the prompt only with mouse unless you get that option. However C-g is pretty ubiquitous still, so maybe ok anyways? |
I think the option was added for the case of only one option, as @nemethf suggests. Doesn't seem to be there for mouse-clicking, since it's in the You can try your hand at a |
I see. So it is intended behaviour not to auto-action when only one action is offered? It feels like the behaviour I would want is for it to execute, trusting server to do the correct thing if it is unambiguous I see three approaches:
I guess the third option is the least destructive to other peoples workflows, (yet improving on mine :) ) Regarding |
Yes.
I'd like to avoid 3, if I can. 2 is possible, maybe adding an informative message. 1 doesn't seem so bad tbh. Would you rather have a
If you come up with a good wrapper for this, a good place to put it is in Emacs itself (though it can start out its life in Eglot). |
The reason I want this change is that when I do some refactoring, I like to use LSPs help with for example imports. If there are a lot of imports that needs to update, or if I add a method to the file, it's a lot of steps before server does anything. My last PR (defcustom confirm-server-initiated-edits) fixes one of these, but for all of these small imports I'd like not to confirm each time. It's not terrible, by all means. Just feels a tiny bit too repetetive. Also, at work, I need to use Windows, which has super slow IO, so getting these prompts take a few seconds each time
I will think about this |
If
Been there. But it's usually much worse with launching processes, not particularly with sending things through stdin/stdout, in my experience. If your LSP server supports it, though, communicating via network sockets might be much, much faster (Common Lisp's SLY/SLIME use that technique very effectively). |
* eglot.el (eglot-code-actions): add option to now show the never-mind in tmm prompt. This allows for autmatic execution of code actions if only one available. Uses defcustom to determine this * README.md: Name change Copyright-paperwork-exempt: yes
154d159
to
59a65f6
Compare
Made changes to the defcustom and wrapped the thing in another if. What do you think?
I didn't get this working in I'll look into getting FSF agreement. Do I just mail fsf? |
Too many unsolicited whitespace changes. Also in the other PR. If you want to do this cleanup, open a separate PR. |
Maybe that works, too, but I've seen people just mail |
* eglot.el (eglot-code-actions): add option to now show the never-mind in tmm prompt. This allows for autmatic execution of code actions if only one available. Uses defcustom to determine this * README.md: Name change Copyright-paperwork-exempt: yes
59a65f6
to
d33d595
Compare
* eglot.el (eglot-code-actions): add option to now show the never-mind in tmm prompt. This allows for autmatic execution of code actions if only one available. Uses defcustom to determine this * README.md: Name change Copyright-paperwork-exempt: yes
d33d595
to
ba82b24
Compare
Sorry - wasn't meant to be added. Fixed! |
I'm sorry to butt in, but I think it would be a bit better UI, if a message with the title of the action was displayed to the user in the case of auto-execution and a single action item. That way the users would receive an extra info helping them to decide whether they want to undo the action or not. I guess most of the time they don't want to undo, so this would indeed result in a simpler workflow. Additionally, isn't a define-obsolete-variable-alias necessary? |
Not necessarily in Eglot, and not necessarily for changing the name of such a new variable, I think. |
Regarding the rest of your comment, yes it makes sense. @theothornhill I haven't checked the code yet, but I'd like you to add @nemethf's suggestion regardless. |
I'm glad you did!
I agree completely and will make an effort to fix this :) |
* eglot.el (eglot-code-actions): add option to now show the never-mind in tmm prompt. This allows for autmatic execution of code actions if only one available. Uses defcustom to determine this * README.md: Name change Copyright-paperwork-exempt: yes
I'm closing this in favour of my next PR |
See also #386. * eglot.el (eglot-code-actions): Replace tmm with completing-read Copyright-paperwork-exempt: yes Co-authored-by: João Távora <[email protected]>
See also joaotavora/eglot#386. * eglot.el (eglot-code-actions): Replace tmm with completing-read Copyright-paperwork-exempt: yes Co-authored-by: João Távora <[email protected]>
See also joaotavora/eglot#386. * eglot.el (eglot-code-actions): Replace tmm with completing-read Copyright-paperwork-exempt: yes Co-authored-by: João Távora <[email protected]>
See also #386. * eglot.el (eglot-code-actions): Replace tmm with completing-read Copyright-paperwork-exempt: yes Co-authored-by: João Távora <[email protected]> #393: joaotavora/eglot#393 #386: joaotavora/eglot#386
See also joaotavora/eglot#386. * eglot.el (eglot-code-actions): Replace tmm with completing-read Copyright-paperwork-exempt: yes Co-authored-by: João Távora <[email protected]> GitHub-reference: close joaotavora/eglot#393
This PR removes the never mind option in tmm when using code action. The prompt already clearly states that C-g or ESC ESC ESC is enough to cancel, so I think never mind option only adds noise.
Yet again mostly a suggestion fix :)