Skip to content

Commit

Permalink
Delay load yasnippet even more (#4413)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiennq authored Apr 1, 2024
1 parent 4e37c36 commit cde52c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/lsp-erlang.el
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ tokens legend."
:modifiers
,(lsp-erlang-elp--semantic-modifiers))
:server-id 'elp
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (featurep 'yasnippet))))))
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode))))))
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure 'erlang-language-platform callback error-callback))))

Expand Down
2 changes: 1 addition & 1 deletion clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
:semantic-tokens-faces-overrides `( :discard-default-modifiers t
:modifiers ,(lsp-rust-analyzer--semantic-modifiers))
:server-id 'rust-analyzer
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (featurep 'yasnippet))))))
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode))))))
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure 'rust-analyzer callback error-callback))))

Expand Down
4 changes: 2 additions & 2 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
(require 'xref)
(require 'minibuffer)
(require 'help-mode)
(require 'yasnippet nil t)
(require 'lsp-protocol)

(defgroup lsp-mode nil
Expand Down Expand Up @@ -3680,7 +3679,7 @@ disappearing, unset all the variables related to it."
(resolveSupport . ((properties . ["edit" "command"])))
(dataSupport . t)))
(completion . ((completionItem . ((snippetSupport . ,(cond
((and lsp-enable-snippet (not (featurep 'yasnippet)) t)
((and lsp-enable-snippet (not (fboundp 'yas-minor-mode)))
(lsp--warn (concat
"Yasnippet is not installed, but `lsp-enable-snippet' is set to `t'. "
"You must either install yasnippet, or disable snippet support."))
Expand Down Expand Up @@ -4479,6 +4478,7 @@ from language server.")
"Wrapper of `yas-expand-snippet' with all of it arguments.
The snippet will be convert to LSP style and indent according to
LSP server result."
(require 'yasnippet nil t)
(let* ((inhibit-field-text-motion t)
(yas-wrap-around-region nil)
(yas-indent-line 'none)
Expand Down

0 comments on commit cde52c8

Please sign in to comment.