[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 64c7605 03/22: Adjust active param highlighting i
From: |
João Távora |
Subject: |
[elpa] externals/eglot 64c7605 03/22: Adjust active param highlighting in first line of signature (1/3) |
Date: |
Sat, 5 Jan 2019 09:31:02 -0500 (EST) |
branch: externals/eglot
commit 64c7605cd871b38d1c602e125705c484950f4bf6
Author: Fredrik Bergroth <address@hidden>
Commit: João Távora <address@hidden>
Adjust active param highlighting in first line of signature (1/3)
address@hidden/12/16: Previously, the whole first line of the rendered
documentation was searched for, potentially highlighting params
in the wrong place.
Copyright-paperwork-exempt: yes
* eglot.el (eglot--sig-info): Search for active parameter within
`params-start` and `params-end`.
---
eglot.el | 65 +++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 34 insertions(+), 31 deletions(-)
diff --git a/eglot.el b/eglot.el
index 2b51c21..46cfb59 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1941,38 +1941,41 @@ is not active."
(eglot--dbind ((SignatureInformation) label documentation parameters) sig
(with-temp-buffer
(save-excursion (insert label))
- (when (looking-at "\\([^(]+\\)(")
- (add-face-text-property (match-beginning 1) (match-end 1)
- 'font-lock-function-name-face))
-
- (when (and (stringp documentation) (eql i active-sig)
- (string-match "[[:space:]]*\\([^.\r\n]+[.]?\\)"
- documentation))
- (setq documentation (match-string 1 documentation))
- (unless (string-prefix-p (string-trim documentation) label)
- (goto-char (point-max))
- (insert ": " (eglot--format-markup documentation))))
- (when (and (eql i active-sig) active-param
- (< -1 active-param (length parameters)))
- (eglot--dbind ((ParameterInformation) label documentation)
- (aref parameters active-param)
- (goto-char (point-min))
- (let ((case-fold-search nil))
- (cl-loop for nmatches from 0
- while (and (not (string-empty-p label))
- (search-forward label nil t))
- finally do
- (when (= 1 nmatches)
- (add-face-text-property
- (- (point) (length label)) (point)
- 'eldoc-highlight-function-argument))))
- (when documentation
+ (let ((params-start (point-min))
+ (params-end (point-max)))
+ (when (looking-at "\\([^(]+\\)(")
+ (setq params-start (match-end 0))
+ (add-face-text-property (match-beginning 1) (match-end 1)
+ 'font-lock-function-name-face))
+
+ (when (and (stringp documentation) (eql i active-sig)
+ (string-match "[[:space:]]*\\([^.\r\n]+[.]?\\)"
+ documentation))
+ (setq documentation (match-string 1 documentation))
+ (unless (string-prefix-p (string-trim documentation) label)
(goto-char (point-max))
- (insert "\n"
- (propertize
- label 'face 'eldoc-highlight-function-argument)
- ": " (eglot--format-markup documentation)))))
- (buffer-string)))
+ (insert ": " (eglot--format-markup documentation))))
+ (when (and (eql i active-sig) active-param
+ (< -1 active-param (length parameters)))
+ (eglot--dbind ((ParameterInformation) label documentation)
+ (aref parameters active-param)
+ (goto-char params-start)
+ (let ((case-fold-search nil))
+ (cl-loop for nmatches from 0
+ while (and (not (string-empty-p label))
+ (search-forward label params-end t))
+ finally do
+ (when (= 1 nmatches)
+ (add-face-text-property
+ (- (point) (length label)) (point)
+ 'eldoc-highlight-function-argument))))
+ (when documentation
+ (goto-char (point-max))
+ (insert "\n"
+ (propertize
+ label 'face 'eldoc-highlight-function-argument)
+ ": " (eglot--format-markup documentation)))))
+ (buffer-string))))
when moresigs concat "\n"))
(defun eglot-help-at-point ()
- [elpa] externals/eglot updated (23accee -> 35597d2), João Távora, 2019/01/05
- [elpa] externals/eglot cc5ef6c 02/22: Apply eglot--format-markup to signature documentation, João Távora, 2019/01/05
- [elpa] externals/eglot d77b447 04/22: Adjust active param highlighting in first line of signature (2/3), João Távora, 2019/01/05
- [elpa] externals/eglot ef95839 05/22: Adjust active param highlighting in first line of signature (3/3), João Távora, 2019/01/05
- [elpa] externals/eglot 64c7605 03/22: Adjust active param highlighting in first line of signature (1/3),
João Távora <=
- [elpa] externals/eglot e8b9cbf 16/22: Slightly simplify eglot-completion-at-point, João Távora, 2019/01/05
- [elpa] externals/eglot d5521e9 12/22: Remove workaround for company bug that has been fixed, João Távora, 2019/01/05
- [elpa] externals/eglot d167c80 15/22: Fix #190: actually make completion sorting work, João Távora, 2019/01/05
- [elpa] externals/eglot 476feb8 07/22: Add edebug specs to destructuring macros, João Távora, 2019/01/05
- [elpa] externals/eglot b8a8901 09/22: Fix #187: be more careful when making xref summaries, João Távora, 2019/01/05
- [elpa] externals/eglot 2f0e51a 13/22: Per #188: use gfm-view-mode, João Távora, 2019/01/05
- [elpa] externals/eglot b393c48 14/22: Fix previous commit where workaround had been removed, João Távora, 2019/01/05
- [elpa] externals/eglot 64da240 19/22: Fix #196: run connection hooks with proper dir-locals, João Távora, 2019/01/05
- [elpa] externals/eglot af9dcad 10/22: Take over Flymake and Eldoc completely while managing buffers, João Távora, 2019/01/05
- [elpa] externals/eglot 5b9a164 01/22: Per #180: frame lsp-mode.el comparison as historical even more evidently, João Távora, 2019/01/05