From 33583c642a3ff08d94c2226fa4df7b2204a1e3ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 13 May 2018 23:25:15 +0100 Subject: [PATCH] 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 --- lisp/progmodes/eglot.el | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.39.2