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

Is there a minimum supported elixir version? #234

Closed
rossvz opened this issue Sep 21, 2023 · 10 comments · Fixed by #235 or #236
Closed

Is there a minimum supported elixir version? #234

rossvz opened this issue Sep 21, 2023 · 10 comments · Fixed by #235 or #236

Comments

@rossvz
Copy link

rossvz commented Sep 21, 2023

We have a two different elixir projects - one that is using 1.14 and OTP25, and another that's stuck on 1.13 with OTP25.

The 1.14 project is smaller/simpler (~5k loc for Elixir) and seems to work with next-ls wonderfully!

The 1.13 project is significantly larger (~100k loc of Elixir) and has some weirdness with private git dependencies. It seems to crash or struggle a bit. Syntax highlighting works, but not getting any formatting or error reporting

I wanted to first check if the Elixir version would be a factor here as I continue to debug. Possibly something about my setup and private git deps could be the problem?

@mhanberg
Copy link
Collaborator

1.13 should work I think.

Which editor are you using?

In VSCode, there is an output panel that will have a drop down selector to choose nextls. Can you let me know if there are any errors in there with the bigger project?

If you use neovim, I have a plugin to make a similar panel https://github.com/mhanberg/output-panel.nvim

@rossvz
Copy link
Author

rossvz commented Sep 21, 2023

Last line from the output:
(app is called chunky-kong)

12:15:09.533 [error] GenServer :"sidecar-chunky-kong" terminating
** (File.Error) could not read file "lib/oban/worker.ex": no such file or directory
    (elixir 1.15.4) lib/file.ex:358: File.read!/1
    (next_ls 0.12.5) lib/next_ls/helpers/ast_helpers.ex:75: NextLS.ASTHelpers.Attributes.ast_from_file/1
    (next_ls 0.12.5) lib/next_ls/helpers/ast_helpers.ex:8: NextLS.ASTHelpers.Attributes.get_attribute_reference_name/3
    (next_ls 0.12.5) lib/next_ls/runtime/sidecar.ex:63: NextLS.Runtime.Sidecar.handle_info/2
    (stdlib 5.0.2) gen_server.erl:1077: :gen_server.try_handle_info/3
    (stdlib 5.0.2) gen_server.erl:1165: :gen_server.handle_msg/6
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message: {{:tracer, :reference, :attribute}, %{arity: 1, meta: [line: 7, column: 27], module: Instinct.Delivery.Chat.ReceiveWorker, type: :attribute, file: "lib/oban/worker.ex", identifier: :@, source: "user"}}
State: %{db: :"db-chunky-kong"}

I see (elixir 1.15.4) in the output there 🤔

@mhanberg
Copy link
Collaborator

mhanberg commented Sep 21, 2023

I see (elixir 1.15.4) in the output there 🤔

Next LS is packaged using a library called Burrito, so it bundles its own Elixir/OTP. It still starts an isolated runtime for your project using the elixir it finds in your path.

** (File.Error) could not read file "lib/oban/worker.ex": no such file or directory

Is this a file in your project? or is this from a git dependency?

@rossvz
Copy link
Author

rossvz commented Sep 21, 2023

Yeah - I think this is referencing a file that we use that uses the Oban library.

I just tracked it down and I think this is the problem line:

  use Oban.Worker, queue: @queue

@mhanberg
Copy link
Collaborator

The weird thing is why that file was not found.

I will push a fix to make this not crash tho and can figure out why later. It should gracefully degrade rather than crash

@mhanberg
Copy link
Collaborator

Oh, that use macro might be injecting an attribute.

@rossvz
Copy link
Author

rossvz commented Sep 21, 2023

I believe it invokes this from Oban.Worker

@mhanberg
Copy link
Collaborator

@rossvz i published 0.12.6, can you update and try again?

to update, you should just be able to restart and it wil automatically update, and hten you can restart again. or you can uninstall the existing one from the command palette "Uninstall Next LS" and then restart and it will download it again for you

@rossvz
Copy link
Author

rossvz commented Sep 21, 2023

Yeah looks fixed! Thanks!

@mhanberg
Copy link
Collaborator

Excellent! Thanks for being an early adopter and reporting bugs 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment