]> git.eshelyaron.com Git - emacs.git/commitdiff
Use rls in travis ci and add actual tests
authorJoão Távora <joaotavora@gmail.com>
Sun, 13 May 2018 22:25:15 +0000 (23:25 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 13 May 2018 23:54:13 +0000 (00:54 +0100)
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

index 3d5d4927ece7298faa190e6136ff8836515eed48..447724283cfbba5fe2008d2e0914c08b8d9da00f 100644 (file)
@@ -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)