[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa 8160cd4 071/139: Handle dynamic registration in ge
From: |
João Távora |
Subject: |
[elpa] externals/elpa 8160cd4 071/139: Handle dynamic registration in general (but nothing specific yet) |
Date: |
Mon, 14 May 2018 09:53:38 -0400 (EDT) |
branch: externals/elpa
commit 8160cd41fd7c0ff1ce436da2d1100f14f7c33efe
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Handle dynamic registration in general (but nothing specific yet)
* eglot.el (eglot--server-client/registerCapability): Implement.
(eglot--register-workspace/didChangeWatchedFiles): Dummy registrator.
---
eglot.el | 41 ++++++++++++++++++++++++++++++++---------
1 file changed, 32 insertions(+), 9 deletions(-)
diff --git a/eglot.el b/eglot.el
index 68fe3e2..2b3f270 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1003,15 +1003,28 @@ running. INTERACTIVE is t if called interactively."
(cl-defun eglot--server-client/registerCapability
(proc &key id registrations)
"Handle notification client/registerCapability"
- (mapc (lambda (reg)
- (apply (cl-function
- (lambda (&key _id _method _registerOptions)
- ;;; TODO: handle this
- ))
- reg))
- registrations)
- (eglot--reply proc id :error (eglot--obj :code -32601
- :message "sorry :-(")))
+ (catch 'done
+ (mapc
+ (lambda (reg)
+ (apply
+ (cl-function
+ (lambda (&key id method registerOptions)
+ (pcase-let*
+ ((handler-sym (intern (concat "eglot--register-"
+ method)))
+ (`(,ok ,message)
+ (and (functionp handler-sym)
+ (apply handler-sym proc :id id registerOptions))))
+ (unless ok
+ (throw
+ 'done
+ (eglot--reply proc id
+ :error (eglot--obj
+ :code -32601
+ :message (or message "sorry :-("))))))))
+ reg))
+ registrations)
+ (eglot--reply proc id :result (eglot--obj :message "OK"))))
(defvar eglot--recent-before-changes nil
"List of recent changes as collected by `eglot--before-change'.")
@@ -1177,6 +1190,16 @@ Calls REPORT-FN maybe if server publishes diagnostics in
time."
(eglot--signal-textDocument/didChange))
+;;; Dynamic registration
+;;;
+(cl-defun eglot--register-workspace/didChangeWatchedFiles
+ (_proc &key _id _watchers)
+ "Handle dynamic registration of workspace/didChangeWatchedFiles"
+ ;; TODO: file-notify-add-watch and
+ ;; file-notify-rm-watch can probably handle this
+ (list nil "Sorry, can't do this yet"))
+
+
;;; Rust-specific
;;;
(cl-defun eglot--server-window/progress
- [elpa] externals/elpa d90efdf 001/139: Initial commit, (continued)
- [elpa] externals/elpa d90efdf 001/139: Initial commit, João Távora, 2018/05/14
- [elpa] externals/elpa 29d4103 056/139: Fix mode-line mouse-clicks from outside selected window, João Távora, 2018/05/14
- [elpa] externals/elpa ea918ab 066/139: Include source info in diagnostics, João Távora, 2018/05/14
- [elpa] externals/elpa 2b61a3b 048/139: Delete two useless forward declarations, João Távora, 2018/05/14
- [elpa] externals/elpa 7d0bf64 062/139: Workaround RLS's regusal to treat nil as empty json object, João Távora, 2018/05/14
- [elpa] externals/elpa e7ffc31 067/139: Make reported capabilities into its own function, João Távora, 2018/05/14
- [elpa] externals/elpa c2862f4 063/139: Don't auto-reconnect if last attempt lasted less than 3 seconds, João Távora, 2018/05/14
- [elpa] externals/elpa e86f9b4 073/139: New helper eglot--sync-request, João Távora, 2018/05/14
- [elpa] externals/elpa 95187cf 058/139: Connect to LSP server via TCP, João Távora, 2018/05/14
- [elpa] externals/elpa f8bfb7e 064/139: Handle requests from server correctly, João Távora, 2018/05/14
- [elpa] externals/elpa 8160cd4 071/139: Handle dynamic registration in general (but nothing specific yet),
João Távora <=
- [elpa] externals/elpa 9ff97a6 079/139: Increase request timeout length to 10 seconds, João Távora, 2018/05/14
- [elpa] externals/elpa 193c57d 075/139: Half-decent xref support, João Távora, 2018/05/14
- [elpa] externals/elpa d254f97 082/139: Solve another textDocument/didChange bug, João Távora, 2018/05/14
- [elpa] externals/elpa a7ddce6 080/139: Support javascript's javascript-typescript-langserver, João Távora, 2018/05/14
- [elpa] externals/elpa af14364 093/139: Only request stuff that server says it's capable of, João Távora, 2018/05/14
- [elpa] externals/elpa d33a9b5 103/139: Simplify eglot--signal-textDocument/didChange, João Távora, 2018/05/14
- [elpa] externals/elpa 56c2e1d 104/139: Get rid of eglot-mode, João Távora, 2018/05/14
- [elpa] externals/elpa bbc64b4 087/139: Clean up client capabilities, João Távora, 2018/05/14
- [elpa] externals/elpa 23b79e0 111/139: Shorten summary line to appease package-lint.el, João Távora, 2018/05/14
- [elpa] externals/elpa 24466a9 096/139: When killing server, always wait 3 seconds, João Távora, 2018/05/14