Cancelling out of a code-actions dropdown signals non-user error. Fix that. #1056
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to address the issue found and commented in the PR #1054 (comment).
Issue description
Here is that issue. Steps:
At any point, where there are code actions available.
Invoke the diagnosis with mouse-1.
Then cancel it by clicking away the poped up menu (i.e. not selecting any of the code actions)
This would result in the following error (with backtrace enabled, some deeper down frames are ommited):
I would consider this as a bug, since invoking the code actions via eglot-code-action lands users into a completing-read prompt, which can be exited out using C-g. Therefore, it would not land into a nil case like using mouse-1 would do.
Proposed fix
Using
t
explicitly allowsx-pop-menu
to quit instead of returningnil
when mouse button event is passed.Otherwise, the dcase later on will error out on the
nil
action.I used the term lost fucs, which I mean that the focus is lost when the user gets rid of the menu without making a valid choice... (see
(describe-function x-pop-menu)
)