[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 75495dc 033/139: Slightly more user friendly star
From: |
João Távora |
Subject: |
[elpa] externals/eglot 75495dc 033/139: Slightly more user friendly start |
Date: |
Mon, 14 May 2018 09:54:49 -0400 (EDT) |
branch: externals/eglot
commit 75495dcb2ce2d1e4e0ee3ebfab990b8f1731ac01
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Slightly more user friendly start
* eglot.el (eglot-new-process): signal DidOpen for every file in project.
(eglot-editing-mode): Offer to start process.
---
eglot.el | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/eglot.el b/eglot.el
index 6e5954c..d3428a7 100644
--- a/eglot.el
+++ b/eglot.el
@@ -193,7 +193,17 @@ INTERACTIVE is t if called interactively."
major-mode))
probe)))
(lambda ()
- (eglot--message "Connected"))))))))
+ (eglot--message "Connected")
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (if (and buffer-file-name
+ (cl-some
+ (lambda (root)
+ (string-prefix-p
+ (expand-file-name root)
+ (expand-file-name buffer-file-name)))
+ (project-roots project)))
+ (eglot--signalDidOpen)))))))))))
(defun eglot--process-sentinel (process change)
"Called with PROCESS undergoes CHANGE."
@@ -647,16 +657,19 @@ running. INTERACTIVE is t if called interactively."
nil
nil
eglot-mode-map
- (cond (eglot-editing-mode
- (eglot-mode 1)
- (add-hook 'after-change-functions 'eglot--after-change nil t)
- (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t)
- (if (eglot--current-process)
- (eglot--signalDidOpen)
- (eglot--warn "No process")))
- (t
- (remove-hook 'flymake-diagnostic-functions 'eglot-flymake-backend t)
- (remove-hook 'after-change-functions 'eglot--after-change t))))
+ (cond
+ (eglot-editing-mode
+ (eglot-mode 1)
+ (add-hook 'after-change-functions 'eglot--after-change nil t)
+ (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t)
+ (if (eglot--current-process)
+ (eglot--signalDidOpen)
+ (if (y-or-n-p "No process, try to start one with `eglot-new-process'? ")
+ (eglot-new-process t)
+ (eglot--warn "No process"))))
+ (t
+ (remove-hook 'flymake-diagnostic-functions 'eglot-flymake-backend t)
+ (remove-hook 'after-change-functions 'eglot--after-change t))))
(define-minor-mode eglot-mode
"Minor mode for all buffers managed by EGLOT in some way." nil
- [elpa] externals/eglot 17e0ca4 047/139: Fix Flymake diagnostic positions, (continued)
- [elpa] externals/eglot 17e0ca4 047/139: Fix Flymake diagnostic positions, João Távora, 2018/05/14
- [elpa] externals/eglot 9d404c9 054/139: Update README.md, João Távora, 2018/05/14
- [elpa] externals/eglot 29d4103 056/139: Fix mode-line mouse-clicks from outside selected window, João Távora, 2018/05/14
- [elpa] externals/eglot b1554fc 055/139: * eglot.el (eglot--process-receive): Skip null method notifs., João Távora, 2018/05/14
- [elpa] externals/eglot 51ff863 046/139: Must re-announce didOpen after reconnect, João Távora, 2018/05/14
- [elpa] externals/eglot c95a0a4 041/139: Multiple servers per project are possible, João Távora, 2018/05/14
- [elpa] externals/eglot f8bfb7e 064/139: Handle requests from server correctly, João Távora, 2018/05/14
- [elpa] externals/eglot b69302c 060/139: Make M-x eglot's interactive spec a separate function, João Távora, 2018/05/14
- [elpa] externals/eglot b657b32 068/139: Use rootUri instead of rootPath, João Távora, 2018/05/14
- [elpa] externals/eglot 7d0bf64 062/139: Workaround RLS's regusal to treat nil as empty json object, João Távora, 2018/05/14
- [elpa] externals/eglot 75495dc 033/139: Slightly more user friendly start,
João Távora <=
- [elpa] externals/eglot fdb4de1 039/139: Simplify flymake integration, João Távora, 2018/05/14
- [elpa] externals/eglot cc183a6 043/139: Fix assorted bugs, João Távora, 2018/05/14
- [elpa] externals/eglot df5d76d 065/139: Reply to client/registerCapability (don't handle it yet), João Távora, 2018/05/14
- [elpa] externals/eglot c2862f4 063/139: Don't auto-reconnect if last attempt lasted less than 3 seconds, João Távora, 2018/05/14
- [elpa] externals/eglot f1b6485 053/139: Trim some edges and add a bunch of boring RPC methods, João Távora, 2018/05/14
- [elpa] externals/eglot 0e95167 042/139: Watch for files opened under umbrella of existing process, João Távora, 2018/05/14
- [elpa] externals/eglot 4d4b85d 061/139: eglot-editing-mode becomes eglot--managed-mode, João Távora, 2018/05/14
- [elpa] externals/eglot e7ffc31 067/139: Make reported capabilities into its own function, João Távora, 2018/05/14
- [elpa] externals/eglot 79a2a1e 069/139: Be quite explicit about our lack of capabilities right now, João Távora, 2018/05/14
- [elpa] externals/eglot 95187cf 058/139: Connect to LSP server via TCP, João Távora, 2018/05/14