Eglot: fix likely off-by-1 in LabelOffsetSupport feature (bug#79259)

This feature was tweaked and last tested with a 2019 edition of
the 'ccls' LSP.  The spec does not clearly specify this number
to be 0-indexed, but it would make sense that it would be so.
So there's not need to 1+ - correct the numbers at all before
using them in substring.  This would fix the Haskell server use
of this feature (which is bug#79259)

* lisp/progmodes/eglot.el (eglot--sig-info): Fix likely off-by-1.
This commit is contained in:
João Távora 2025-08-30 11:43:41 +01:00
parent 467c75893c
commit 53f5a07beb

View file

@ -3718,7 +3718,7 @@ for which LSP on-type-formatting should be requested."
(let ((case-fold-search nil))
(and (search-forward parlabel (line-end-position) t)
(list (match-beginning 0) (match-end 0))))
(mapcar #'1+ (append parlabel nil)))))
(list (aref parlabel 0) (aref parlabel 1)))))
(if (and beg end)
(add-face-text-property
beg end