Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(lsp-package-version) error prevents lsp from initializing in buffer #4660

Open
2 of 3 tasks
zmaxus opened this issue Dec 27, 2024 · 0 comments · May be fixed by #4662
Open
2 of 3 tasks

(lsp-package-version) error prevents lsp from initializing in buffer #4660

zmaxus opened this issue Dec 27, 2024 · 0 comments · May be fixed by #4662
Labels

Comments

@zmaxus
Copy link

zmaxus commented Dec 27, 2024

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

(lsp-version) and recently introduced(lsp-package-version) functions return error if the lsp-mode package is installed via non recommended methods, e.g. via elpaca or straight.el, and not with standard package.el. It was not a problem until recent introduction of lsp copilot feature (Commit 83da5b6). Now it seems the error prevents lsp from initializing (see backtrace).

Steps to reproduce

  1. Install latest version of the package via elpaca or straight.el.
  2. Try to enable lsp in a buffer.

Expected behavior

Successful connection to a language server

Which Language Server did you use?

Pyright, fort-ls

OS

Linux

Error callstack

Debugger entered--Lisp error: (wrong-type-argument package-desc nil)
  package-desc-version(nil)
  lsp-package-version()
  lsp-copilot--server-initialization-options()
  lsp--create-initialization-options(#s(lsp-session :folders ...))
  lsp--start-connection(#s(lsp-session :folders ...))
  #f(compiled-function (client) #<bytecode 0x6adf9810901972b>)(#s(lsp--client ...
  -map(#f(compiled-function (client) #<bytecode 0x6adf9810901972b>) (#s(lsp--client ...)
  lsp--ensure-lsp-servers(#s(lsp-session :folders ...))
  lsp--try-project-root-workspaces(nil nil)
  lsp(nil)
  funcall-interactively(lsp nil)
  command-execute(lsp record)
  execute-extended-command(nil "lsp" "lsp")
  funcall-interactively(execute-extended-command nil "lsp" "lsp")
  command-execute(execute-extended-command)

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant