[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 8160cd4 071/139: Handle dynamic registration in g
From: |
João Távora |
Subject: |
[elpa] externals/eglot 8160cd4 071/139: Handle dynamic registration in general (but nothing specific yet) |
Date: |
Mon, 14 May 2018 09:54:56 -0400 (EDT) |
branch: externals/eglot
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/eglot 3e0f1c3 122/139: Misc little adjustments for readability, (continued)
- [elpa] externals/eglot 3e0f1c3 122/139: Misc little adjustments for readability, João Távora, 2018/05/14
- [elpa] externals/eglot 3dcbc30 109/139: Add minimal headers, commentary and autoloads, João Távora, 2018/05/14
- [elpa] externals/eglot 71e47d2 102/139: Fix odd bugs and tweak stuff, João Távora, 2018/05/14
- [elpa] externals/eglot 05c67ee 112/139: Adjust flymake integration, João Távora, 2018/05/14
- [elpa] externals/eglot 9ff97a6 079/139: Increase request timeout length to 10 seconds, João Távora, 2018/05/14
- [elpa] externals/eglot 571b08f 076/139: Fix the odd bug here and there, João Távora, 2018/05/14
- [elpa] externals/eglot a7ddce6 080/139: Support javascript's javascript-typescript-langserver, João Távora, 2018/05/14
- [elpa] externals/eglot d40f9ac 094/139: Half-decent imenu support via textDocument/documentSymbol, João Távora, 2018/05/14
- [elpa] externals/eglot bbc64b4 087/139: Clean up client capabilities, João Távora, 2018/05/14
- [elpa] externals/eglot 9882bf2 072/139: Cleanup mistake with TextDocumentItem and TextDocumentIdentifier, João Távora, 2018/05/14
- [elpa] externals/eglot 8160cd4 071/139: Handle dynamic registration in general (but nothing specific yet),
João Távora <=
- [elpa] externals/eglot c4ffabc 083/139: Half-decent completion support, João Távora, 2018/05/14
- [elpa] externals/eglot d431d41 088/139: Fix bug in hover support, João Távora, 2018/05/14
- [elpa] externals/eglot 1356844 097/139: Fix odd bugs, João Távora, 2018/05/14
- [elpa] externals/eglot 6e76b08 100/139: Support workspace/applyEdit, João Távora, 2018/05/14
- [elpa] externals/eglot 5ce9ab0 106/139: Call eglot-eldoc-function after completion finishes, João Távora, 2018/05/14
- [elpa] externals/eglot ecd334f 101/139: Update README, João Távora, 2018/05/14
- [elpa] externals/eglot 39e8b9e 081/139: Add (dummy) tests and Travis CI integration, João Távora, 2018/05/14
- [elpa] externals/eglot 23b79e0 111/139: Shorten summary line to appease package-lint.el, João Távora, 2018/05/14
- [elpa] externals/eglot 37b7329 098/139: Reasonable textDocument/documentHighlight support, João Távora, 2018/05/14
- [elpa] externals/eglot d1cdcf1 119/139: Friendlier M-x eglot, João Távora, 2018/05/14