From 051bc27a101f0c9f3376194ec53842c87d31e94e Mon Sep 17 00:00:00 2001 From: galeo Date: Thu, 26 Sep 2019 20:04:13 +0800 Subject: [PATCH] Also use signature label offsets for parameter info According to the LSP specification, a parameter of a callable-signature has a label and a optional doc-commet. The label of a parameter information is either a string or an inclusive start and exclusive end offsets within its containing signature label. Previously, this was only taken in account for highlighting the parameter in the definition signature. * eglot.el (eglot--sig-info): Handle signature label offsets when printing the signature parameter information. Copyright-paperwork-exempt: yes GitHub-reference: fix https://github.com/joaotavora/eglot/issues/272 --- lisp/progmodes/eglot.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 3155135b304..723ac3bc89c 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2055,7 +2055,10 @@ is not active." (goto-char (point-max)) (insert "\n" (propertize - label 'face 'eldoc-highlight-function-argument) + (if (stringp label) + label + (apply #'buffer-substring (mapcar #'1+ label))) + 'face 'eldoc-highlight-function-argument) ": " (eglot--format-markup documentation)))))) (buffer-string)))) when moresigs concat "\n")) -- 2.39.2