]> git.eshelyaron.com Git - emacs.git/commit
Eglot: filter by prefix in narrow-scope eglot-code-actions
authorJoão Távora <joaotavora@gmail.com>
Mon, 1 Jan 2024 21:12:28 +0000 (15:12 -0600)
committerEshel Yaron <me@eshelyaron.com>
Tue, 2 Jan 2024 08:00:51 +0000 (09:00 +0100)
commitd2d33cbc538bd5fd2f9831f00fe0aa4a78186dfc
tree56d13dc5238ad8cf4238eebad7eb669d64bb8d7b
parent540274796c92de8ca9b6f75f7f97f74841c6d1de
Eglot: filter by prefix in narrow-scope eglot-code-actions

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

Servers like typescript-language-server, when asked for {"only" :
"source.organizeImports"}, return actions with the
"source.organizeImports.ts" kind.  Eglot rejected these actions, but
according to the spec:

  Kinds are a hierarchical list of identifiers separated by `.` [...]
  The set of kinds is open.

So I guess we can use string-prefix-p

* lisp/progmodes/eglot.el (eglot-code-actions): Use string-prefix-p.

(cherry picked from commit 24741d25633084101ab697ba6e28f03e1cdc8b7a)
lisp/progmodes/eglot.el