Skip to content

Commit 689c83e

Browse files
committed
Sync eglot.el and eglot-tests.el from upstream
1 parent ece3adf commit 689c83e

2 files changed

Lines changed: 31 additions & 24 deletions

File tree

eglot-tests.el

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ directory hierarchy."
299299
(eglot-sync-connect t)
300300
(eglot-connect-timeout timeout)
301301
(eglot-server-programs
302-
(if server `((,major-mode . ,(string-split server)))
302+
(if server `((,major-mode . ,(split-string server)))
303303
eglot-server-programs)))
304304
(apply #'eglot--connect (eglot--guess-contact))))
305305

@@ -775,7 +775,7 @@ directory hierarchy."
775775
;; This originally appeared in github#1339
776776
(skip-unless (executable-find "rust-analyzer"))
777777
(skip-unless (executable-find "cargo"))
778-
(skip-when (getenv "EMACS_EMBA_CI"))
778+
(skip-unless (not (getenv "EMACS_EMBA_CI")))
779779
(eglot--with-fixture
780780
'(("cmpl-project" .
781781
(("main.rs" .
@@ -1576,7 +1576,14 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of
15761576
'(3 "Timeout waiting for semantic tokens")
15771577
(while (not (save-excursion
15781578
(goto-char pos)
1579-
(text-property-search-forward 'eglot--semtok-faces)))
1579+
(cl-loop
1580+
for from = (point) then to
1581+
while (< from (point-max))
1582+
for faces = (get-text-property from 'eglot--semtok-faces)
1583+
for to = (or (next-single-property-change
1584+
from 'eglot--semtok-faces)
1585+
(point-max))
1586+
when faces return t)))
15801587
(accept-process-output nil 0.1)
15811588
(font-lock-ensure))))
15821589

eglot.el

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
;; Copyright (C) 2018-2026 Free Software Foundation, Inc.
44

5-
;; Version: 1.20
5+
;; Version: 1.21
66
;; Author: João Távora <joaotavora@gmail.com>
77
;; Maintainer: João Távora <joaotavora@gmail.com>
88
;; URL: https://github.com/joaotavora/eglot
@@ -1132,7 +1132,7 @@ object."
11321132
:rangeFormatting `(:dynamicRegistration :json-false)
11331133
:rename `(:dynamicRegistration :json-false)
11341134
:semanticTokens `(:dynamicRegistration :json-false
1135-
:requests '(:full (:delta t))
1135+
:requests (:full (:delta t))
11361136
:overlappingTokenSupport t
11371137
:multilineTokenSupport t
11381138
:tokenTypes [,@eglot-semantic-token-types]
@@ -2172,21 +2172,21 @@ MARKUP is either an LSP MarkedString or MarkupContent object."
21722172
(setq-local markdown-fontify-code-blocks-natively t)
21732173
(insert string)
21742174
(let ((inhibit-message t)
2175-
(message-log-max nil)
2176-
match)
2175+
(message-log-max nil))
21772176
(ignore-errors (delay-mode-hooks (funcall render-mode)))
21782177
(font-lock-ensure)
21792178
(goto-char (point-min))
21802179
(let ((inhibit-read-only t))
2181-
(when (fboundp 'text-property-search-forward)
2182-
;; If `render-mode' is `gfm-view-mode', the `invisible'
2183-
;; regions are set to `markdown-markup'. Set them to 't'
2184-
;; instead, since this has actual meaning in the "*eldoc*"
2185-
;; buffer where we're taking this string (#bug79552).
2186-
(while (setq match (text-property-search-forward 'invisible))
2187-
(put-text-property (prop-match-beginning match)
2188-
(prop-match-end match)
2189-
'invisible t))))
2180+
;; If `render-mode' is `gfm-view-mode', the `invisible'
2181+
;; regions are set to `markdown-markup'. Set them to 't'
2182+
;; instead, since this has actual meaning in the "*eldoc*"
2183+
;; buffer where we're taking this string (#bug79552).
2184+
(cl-loop for from = (point) then to
2185+
while (< from (point-max))
2186+
for inv = (get-text-property from 'invisible)
2187+
for to = (next-single-property-change from 'invisible)
2188+
when inv
2189+
do (put-text-property from to 'invisible t)))
21902190
(string-trim (buffer-string))))))
21912191

21922192
(defun eglot--read-server (prompt &optional dont-if-just-the-one)
@@ -5017,11 +5017,11 @@ See `eglot--semtok-request' implementation for details.")
50175017

50185018
(defun eglot--semtok-after-send-changes ()
50195019
;; (trace-values "Dispatching")
5020-
(setf (plist-get eglot--semtok-state :dispatched) t))
5020+
(setf (cl-getf eglot--semtok-state :dispatched) t))
50215021

50225022
(cl-defun eglot--semtok-request (beg end &aux (docver eglot--docver))
50235023
"Ask for tokens. Arrange for BEG..END to be font-lock flushed."
5024-
(cl-macrolet ((c (tag) `(plist-get eglot--semtok-state ,tag)))
5024+
(cl-macrolet ((c (tag) `(cl-getf eglot--semtok-state ,tag)))
50255025
(cl-labels
50265026
((req (method &optional params cont
50275027
&aux (buf (current-buffer)))
@@ -5125,12 +5125,12 @@ lock machinery calls us again."
51255125
(with-silent-modifications
51265126
(save-excursion
51275127
(cl-loop
5128-
initially (goto-char beg)
5129-
for match = (text-property-search-forward 'eglot--semtok-faces)
5130-
while (and match (< (point) end))
5131-
do (dolist (f (prop-match-value match))
5132-
(add-face-text-property
5133-
(prop-match-beginning match) (prop-match-end match) f)))))))
5128+
for from = beg then to
5129+
while (< from end)
5130+
for faces = (get-text-property from 'eglot--semtok-faces)
5131+
for to = (or (next-single-property-change from 'eglot--semtok-faces nil end) end)
5132+
when faces
5133+
do (dolist (f faces) (add-face-text-property from to f)))))))
51345134

51355135

51365136
;;; Call and type hierarchies

0 commit comments

Comments
 (0)