Skip to content

Commit

Permalink
Fix joaotavora#340: Don't choke on workspace/configuration with no sc…
Browse files Browse the repository at this point in the history
…opeUri

* eglot.el (eglot-handle-request): Don't choke on nil scopeUri.
  • Loading branch information
joaotavora authored and xuchunyang committed Nov 16, 2019
1 parent 867e90e commit 5de7c55
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1678,20 +1678,23 @@ When called interactively, use the currently active server"
(apply #'vector
(mapcar
(eglot--lambda ((ConfigurationItem) scopeUri section)
(let* ((path (eglot--uri-to-path scopeUri)))
(when (file-directory-p path)
(with-temp-buffer
(let ((default-directory path))
(setq-local major-mode (eglot--major-mode server))
(hack-dir-local-variables-non-file-buffer)
(alist-get section eglot-workspace-configuration
nil nil
(lambda (wsection section)
(string=
(if (keywordp wsection)
(substring (symbol-name wsection) 1)
wsection)
section))))))))
(with-temp-buffer
(let* ((uri-path (eglot--uri-to-path scopeUri))
(default-directory
(if (and (not (string-empty-p uri-path))
(file-directory-p uri-path))
uri-path
(car (project-roots (eglot--project server))))))
(setq-local major-mode (eglot--major-mode server))
(hack-dir-local-variables-non-file-buffer)
(alist-get section eglot-workspace-configuration
nil nil
(lambda (wsection section)
(string=
(if (keywordp wsection)
(substring (symbol-name wsection) 1)
wsection)
section))))))
items)))

(defun eglot--signal-textDocument/didChange ()
Expand Down

0 comments on commit 5de7c55

Please sign in to comment.