You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain
Bug description
After setting the lsp-clients-lua-language-server-bin to my local copy of the lua-language-server, manually starting lsp-mode with M-x lsp prints in the minibuffer:
LSP :: The following servers support current file but automatic download is disabled: lua-language-server copilot-ls
(If you have already installed the server check *lsp-log*).
and there is no lsp-log buffer. I've also disabled lua-roblox-language-server, emmy-lua, and semgrep-ls.
Disable the lua-roblox-language-server, emmy-lua, and semgrep-ls clients
Do NOT automatically start lsp-mode
Set the lsp-clients-lua-language-server-bin after envrc loads the environment
I checked manually using describe-variable that this variable is correctly set before starting lsp-mode
Then, do these steps:
Open a Lua file, which has an associated envrc that adds lua-language-server to PATH
Run M-x lsp
The configuration:
(use-package lsp-mode
:custom
(lsp-completion-provider :none) ;; we use Corfu!:init
(defunkickstart/lsp-mode-setup-completion ()
(setf (alist-get'styles (alist-get'lsp-capf completion-category-defaults))
'(flex))) ;; Configure flex (corfu);; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "C-l l")
(setq lsp-enable-suggest-server-download nil) ;; Do not offer to automatically install LSPs at runtime
(setq lsp-disabled-clients '(lua-roblox-language-server emmy-lua semgrep-ls))
;(setq lsp-log-io t)
(defuncyanide/lsp-mode/set-lua ()
"Run before initializing the LS"
(progn
(setq lsp-clients-lua-language-server-bin (executable-find"lua-language-server"))
))
;:config;(lsp-register-client; (make-lsp-client; :new-connection (lsp-stdio-connection "lua-language-server"); ;:major-modes '(lua-mode); :activation-fn (lsp-activate-on "lua"); :priority 0; :server-id 'lua-language-server); );; To Disable features https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/:hook (;; Automatic Language Modes;(prog-mode . lsp-deferred);(lsp-before-initialize . cyanide/lsp-mode/set-lua);(lsp-before-open . cyanide/lsp-mode/set-lua);(envrc-after-export . lsp-restart-workspace);; Which-key integration
(lsp-mode . lsp-enable-which-key-integration)
;; Corfu
(lsp-completion-mode . kickstart/lsp-mode-setup-completion)
;; Envrc
(envrc-mode . cyanide/lsp-mode/set-lua)
)
:commands (lsp lsp-deferred))
;; optionally
(use-package lsp-ui
:commands lsp-ui-mode)
Expected behavior
Lsp-mode should find lua-language-server through the lsp-clients-lua-language-server-bin variable and correctly start the language server.
Which Language Server did you use?
lua-language-server
OS
MacOS
Error callstack
There's no error
Anything else?
This seems to be a common problem for users who provide their own lsp server locally, either by adding it to the PATH in the emacs environment or through direnv. Perhaps this workflow should be supported and standardized.
The text was updated successfully, but these errors were encountered:
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
After setting the
lsp-clients-lua-language-server-bin
to my local copy of the lua-language-server, manually starting lsp-mode withM-x lsp
prints in the minibuffer:and there is no lsp-log buffer. I've also disabled
lua-roblox-language-server
,emmy-lua
, andsemgrep-ls
.Steps to reproduce
Based on kickstart emacs.
In short, this configuration does:
lua-roblox-language-server
,emmy-lua
, andsemgrep-ls
clientslsp-clients-lua-language-server-bin
after envrc loads the environmentdescribe-variable
that this variable is correctly set before starting lsp-modeThen, do these steps:
lua-language-server
to PATHM-x lsp
The configuration:
Expected behavior
Lsp-mode should find
lua-language-server
through thelsp-clients-lua-language-server-bin
variable and correctly start the language server.Which Language Server did you use?
lua-language-server
OS
MacOS
Error callstack
Anything else?
This seems to be a common problem for users who provide their own lsp server locally, either by adding it to the PATH in the emacs environment or through direnv. Perhaps this workflow should be supported and standardized.
The text was updated successfully, but these errors were encountered: