[Chapel Merge] CLS: fix off-buy-one call inlays in method calls

Branch: refs/heads/main
Revision: d34fd3de24dd5581d73d04685e1a8a501d200f0a
Author: DanilaFe
Link: CLS: fix off-buy-one call inlays in method calls by DanilaFe · Pull Request #28149 · chapel-lang/chapel · GitHub
Log Message:
CLS: fix off-buy-one call inlays in method calls (#28149)

This fixes an issue @jabraham17 encountered in which method calls get
call inlays, but the inlays start with "this", which is not right. It is
not right because the 'this' formal is either the thing-being-dot'ed (as
in x.foo(y)) or supplied implicitly.

To fix this, improve the indexing to be one-indexed when the called
function is a method. This is appropriate in all cases; the this
formal is never provied as part of the arg list. Do this by simplying
prepending a "None" actual to the list of actuals, so that enumerate
continues to work as before.

Also adds a test.

Reviewed by @jabraham17 -- thanks!

Testing

  • all CLS tests pass

Compare: Comparing e8def2539c17f1d9ca15a196aa513acea6cad83e...f589f82eb43abf65ed29e8e50d77532197491956 · chapel-lang/chapel · GitHub

Diff:
M tools/chpl-language-server/src/chpl-language-server.py
M tools/chpl-language-server/test/call_inlays.py
https://github.com/chapel-lang/chapel/pull/28149.diff