Skip to content

Commit

Permalink
Fix joaotavora#272: also use signature label offsets for parameter info
Browse files Browse the repository at this point in the history
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
  • Loading branch information
galeo authored and joaotavora committed Sep 26, 2019
1 parent d774754 commit 36b7cf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 36b7cf3

Please sign in to comment.