From: João Távora Date: Sun, 13 May 2018 22:25:15 +0000 (+0100) Subject: Use rls in travis ci and add actual tests X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~576 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=33583c642a3ff08d94c2226fa4df7b2204a1e3ae;p=emacs.git Use rls in travis ci and add actual tests Also run a hook when connected * eglot-tests.el (eglot--with-dirs-and-files) (eglot--make-file-or-dirs, eglot--call-with-dirs-and-files) (eglot--find-file-noselect): New helpers. (auto-detect-running-server, auto-reconnect): New actual tests. * eglot.el (eglot-connect): Run hook when connected (eglot-connect-hook): New variable * .travis.yml: Use rust stable and install rls * README.md: Update mention of automated tests --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 3d5d4927ece..447724283cf 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -217,6 +217,8 @@ CONTACT is as `eglot--contact'. Returns a process object." :publishDiagnostics `(:relatedInformation :json-false)) :experimental (eglot--obj))) +(defvar eglot-connect-hook nil "Hook run after connecting in `eglot--connect'.") + (defun eglot--connect (project managed-major-mode short-name contact interactive) "Connect for PROJECT, MANAGED-MAJOR-MODE, SHORT-NAME and CONTACT. INTERACTIVE is t if inside interactive call." @@ -238,6 +240,7 @@ INTERACTIVE is t if inside interactive call." (null eglot-autoreconnect))))))) (setf (eglot--short-name proc) short-name) (push proc (gethash project eglot--processes-by-project)) + (run-hook-with-args 'eglot-connect-hook proc) (erase-buffer) (read-only-mode t) (cl-destructuring-bind (&key capabilities)