Subject: Re: bug#79259: [PATCH] Fix arg doc off-by-one bug of eglot signature help

From: Lin Jian <[email-masked]>
Date: Wed, 03 Sep 2025 14:52:23 +0800

João Távora <[email-masked]> writes:

> Is this number 0-indexed?  Hard to say, reading
> https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_signatureHelp

I think it is 0-indexed.  I have verified that using vscode and
rust-analyzer.

> Anyway, I pushed a slightly simpler fix.

That slightly simpler "fix" changes an unrelated line of code.  It
introduces a new off-by-1 bug while keeping the off-by-1 bug my patch
indents to fix unchanged.

There are 3 things here:

1. `add-face-text-property' is 1-indexed
2. `substring' is 0-indexed
3. label offsets of ParameterInformation are 0-indexed

My patch fixes the mis-match of 2 and 3, while the slightly simpler
"fix" changes the correct match of 1 and 3.