Refactor lsp! function
This commit is contained in:
parent
61b7451b52
commit
9b5dce1c56
1 changed files with 12 additions and 8 deletions
|
@ -8,19 +8,23 @@ Meant to be a lighter alternative to `lsp', which is too eager about
|
||||||
initializing lsp-ui-mode, company, yasnippet and flycheck. Instead, these have
|
initializing lsp-ui-mode, company, yasnippet and flycheck. Instead, these have
|
||||||
been moved out to their respective modules, or these hooks:
|
been moved out to their respective modules, or these hooks:
|
||||||
|
|
||||||
+ `+lsp|init-company' (on `lsp-mode-hook')
|
+ `+lsp-init-company-h' (on `lsp-mode-hook')
|
||||||
+ `+lsp|init-ui-flycheck-or-flymake' (on `lsp-ui-mode-hook')"
|
+ `+lsp-init-ui-flycheck-or-flymake-h' (on `lsp-ui-mode-hook')"
|
||||||
(require 'lsp-mode)
|
(require 'lsp-mode)
|
||||||
(unless lsp-mode
|
(unless lsp-mode
|
||||||
(when lsp-auto-configure
|
(when lsp-auto-configure
|
||||||
(require 'lsp-clients))
|
(require 'lsp-clients))
|
||||||
(when (and (buffer-file-name)
|
(when (and (buffer-file-name)
|
||||||
(setq-local lsp--buffer-workspaces
|
(setq-local
|
||||||
(or (lsp--try-open-in-library-workspace)
|
lsp--buffer-workspaces
|
||||||
(lsp--try-project-root-workspaces (equal arg '(4))
|
(or (lsp--try-open-in-library-workspace)
|
||||||
(and arg (not (equal arg 1)))))))
|
(lsp--try-project-root-workspaces
|
||||||
|
(equal arg '(4))
|
||||||
|
(and arg (not (equal arg 1)))))))
|
||||||
(lsp-mode 1)
|
(lsp-mode 1)
|
||||||
(lsp--info
|
(lsp--info
|
||||||
"Connected to %s."
|
"Connected to %s."
|
||||||
(apply #'concat (mapcar (lambda (it) (format "[%s]" (lsp--workspace-print it)))
|
(apply
|
||||||
lsp--buffer-workspaces))))))
|
#'concat (mapcar
|
||||||
|
(lambda (it) (format "[%s]" (lsp--workspace-print it)))
|
||||||
|
lsp--buffer-workspaces))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue