]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: another tweak to eglot--sig-info
authorJoão Távora <joaotavora@gmail.com>
Sun, 2 Jul 2023 10:57:15 +0000 (11:57 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 2 Jul 2023 10:58:04 +0000 (11:58 +0100)
Going to the start of the first param and skipping non-word syntax
backward would seem to be the right thing to do, for traditional
C-style languages and also languages like Ocaml where function
signatures don't start the param list with '('.

See also https://github.com/joaotavora/eglot/discussions/1251.

* lisp/progmodes/eglot.el (eglot--sig-info): Rework again.

lisp/progmodes/eglot.el

index 897cf3bc93e45df48a44a70d17c493eee5729028..f09c348143ddcefc87729c2d6a00278ccb8bc8f5 100644 (file)
@@ -3212,7 +3212,7 @@ for which LSP on-type-formatting should be requested."
            parameter
          (when (zerop i)
            (goto-char (elt parlabel 0))
-           (search-backward "(" nil t)
+           (skip-syntax-backward "^w")
            (add-face-text-property (point-min) (point)
                                    'font-lock-function-name-face))
          ;; ...perhaps highlight it in the formals list