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

From: João Távora <[email-masked]>
Date: Sat, 30 Aug 2025 11:46:42 +0100

Eli Zaretskii <[email-masked]> writes:

> João, are you okay with the patch, given the additional information
> posted by Lin Jian?

The patch is OK in spirit, but I think it can be made simpler.

Anyway was added much ealier than
e33c0a549153fa3894f3b5e9c5e42ce07a1a68c7, in this commit:

   commit 9cedae50a27f0d0d6adee82976654d63c9f67602
   Date:   Wed Jan 9 21:09:35 2019 +0000
    
       Handle label offsets in parameterinformation
       
       At least ccls uses this.

So, I think it's more likely thatn not that we will be breaking ccls, or
at least the 2019 ccls.  Is this number 0-indexed?  Hard to say, reading
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_signatureHelp

However, if it's not 0-indexed, it is 1-indexed at most.  Therefore the
use of '1+' to _add_ to the server-supplied number definitely looks
wrong.  Though, again, it is probably wrong to accomodate exactly 2019
ccls, one of the few servers at the time that used this exotic new
feature.

Anyway, I pushed a slightly simpler fix.  I'm closing this issue.  If
the problem persists, we can reopen.

João