]> git.eshelyaron.com Git - emacs.git/commit
Better way to fix bug#70036
authorJoão Távora <joaotavora@gmail.com>
Thu, 18 Apr 2024 13:03:10 +0000 (08:03 -0500)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:07:38 +0000 (14:07 +0300)
commite638baf0048319e8b7bf1141df8986649152b86a
treedc81258c5d9a91bdee850d30146120b11421f73f
parentc6da051706942b7606cb69232bb693cf4ec1ede2
Better way to fix bug#70036

Cache a new eglot--cached-tdi var per buffer, which contains value to
return from eglot--TextDocumentIdentifier.

This avoids frequent expensive recomputation of a value that requires
potentially many 'file-truename' calls.  This technique is used in a
number of other cases already, like eglot--recent-changes or
eglot--versioned-identifier.

* lisp/progmodes/eglot.el (eglot--cached-tdi): New variable.
(eglot--TextDocumentIdentifier): Tweak.
(eglot--signal-textDocument/didOpen): Clear eglot--cached-tdi.

(cherry picked from commit 3228c1222c99e672ca0cd7599c07ea1db852aa1a)
lisp/progmodes/eglot.el