]> git.eshelyaron.com Git - emacs.git/commit
Eglot: careful when invoking code actions on no symbol at all
authorJoão Távora <joaotavora@gmail.com>
Sat, 6 Jan 2024 23:56:33 +0000 (17:56 -0600)
committerJoão Távora <joaotavora@gmail.com>
Sun, 7 Jan 2024 00:12:14 +0000 (18:12 -0600)
commitb5de9ae8010684a5ed0c6f2703077a61d325ccad
treed8b9316a4bb4b476e9aad8251d9f510343ab6a2f
parent73cb931e5bab1b956f0569cd542468cfa7f4c9a7
Eglot: careful when invoking code actions on no symbol at all

Invoking code actions without a marked region or over a symbol
will trip certain servers up since BEG and END in eglot-code-actions
will be nil, causing 'eglot--pos-to-lsp-position' to assume point (which
is OK) but the 'flymake-diagnostics' call to return all diagnostics.

This causes an absolutely undecipherable JavaScript backtrace to be
sent back to Eglot from typescript-language-server.

Github-reference: https://github.com/joaotavora/eglot/issues/847

* lisp/progmodes/eglot.el (eglot--code-action-bounds): Avoid returning
  (list nil nil)
lisp/progmodes/eglot.el