Have lsp! return non-nil if successful

And fix an issue where +javascript-init-lsp-or-tide-maybe-h would
reference lsp-mode in the rare case where lsp-mode isn't defined (likely
because the user forgot to run `doom refresh` after enabling the :tools
lsp module).
This commit is contained in:
Henrik Lissner 2019-09-02 21:43:12 -04:00
parent 713258ee31
commit e996216714
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 8 deletions

View file

@ -146,7 +146,8 @@ to tide."
;; file-visiting buffer ;; file-visiting buffer
(add-hook 'after-save-hook #'+javascript-init-tide-or-lsp-maybe-h nil 'local) (add-hook 'after-save-hook #'+javascript-init-tide-or-lsp-maybe-h nil 'local)
(or (and (featurep! +lsp) (or (and (featurep! +lsp)
(progn (lsp!) lsp-mode)) (lsp!)
(bound-and-true-p lsp-mode))
;; fall back to tide ;; fall back to tide
(if (executable-find "node") (if (executable-find "node")
(and (require 'tide nil t) (and (require 'tide nil t)

View file

@ -21,10 +21,10 @@ been moved out to their respective modules, or these hooks:
(lsp--try-project-root-workspaces (lsp--try-project-root-workspaces
(equal arg '(4)) (equal arg '(4))
(and arg (not (equal arg 1))))))) (and arg (not (equal arg 1)))))))
(lsp-mode 1) (prog1 (lsp-mode 1)
(lsp--info (lsp--info
"Connected to %s." "Connected to %s."
(apply (apply
#'concat (mapcar #'concat (mapcar
(lambda (it) (format "[%s]" (lsp--workspace-print it))) (lambda (it) (format "[%s]" (lsp--workspace-print it)))
lsp--buffer-workspaces)))))) lsp--buffer-workspaces)))))))