]> git.eshelyaron.com Git - emacs.git/commitdiff
Also use signature label offsets for parameter info
authorgaleo <galeo@users.noreply.github.com>
Thu, 26 Sep 2019 12:04:13 +0000 (20:04 +0800)
committerJoão Távora <joaotavora@gmail.com>
Thu, 26 Sep 2019 12:04:13 +0000 (13:04 +0100)
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

index 3155135b30411f0980ec9cb0b187f58ddb0b00ce..723ac3bc89cc17fa70208e4e31449e14eb5a2cf4 100644 (file)
@@ -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"))