lexical-lsp / vscode-lexical

VSCode extension for Lexical, the modern Elixir language server
Apache License 2.0
36 stars 6 forks source link

enable Elixir 16 support #67

Closed thecristen closed 8 months ago

thecristen commented 8 months ago

After installing today for the first time, on a workspace for a project using Elixir 16.0 and OTP 24.3.4.14, I'm encountering the same issue as described in https://github.com/lexical-lsp/lexical/issues/577, though Elixir 16 support was added to lexical itself two weeks ago in https://github.com/lexical-lsp/lexical/pull/535

Detected Elixir through asdf: /Users/cjones3/.asdf/installs/elixir/1.16.0-otp-24/bin/elixir
FATAL: Lexical is not compatible with Elixir 1.16.0

Lexical is compatible with the following versions of Elixir:

  >= 1.13.0
  >= 1.14.0
  >= 1.15.3

[Error - 9:14:55 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 9:14:55 PM] Connection to server got closed. Server will restart.
true
[Error - 9:14:55 PM] Lexical client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 

I'm on the latest version of this extension, 0.12 that was also published two weeks ago. I also notice there's no Github release for 0.12 as of this writing. Might the updated lexical source not be being picked up in the extension as accessed from the Marketplace?

Blond11516 commented 8 months ago

Hi @thecristen! The issue here is that even though Elixir 1.16 support was merged in 2 weeks ago as you noted, there hasn't been a release of Lexical since then. The easiest fix would be to downgrade your project to 1.15 until a new version of Lexical is released. If you can't or don't want to do that, you can also clone the Lexical repo, build it locally and point the extension to your build as described here. While technically a little more complicated it's really not too hard (ie not harder than any other Elixir project). Should you choose this route, I also recommend trying out the work-in-progress indexer, which enables new features like find references!

Also, I want to note that releases of vscode-lexical aren't tied to releases of Lexical itself. The extension actually downloads the latest release of the language server from Github at runtime, no matter the version of the extension. Ultimately this shouldn't change much of anything in how you use Lexical, but it's a different behavior from what you might be used to from ElixirLS for example.

Finally, the missing 0.12 release is totally my bad. I had actually forgotten about the release action, so I published the 0.12 update manually and forgot to create a Github release 😅 I'll fix that shortly!

I hope that answers your questions!