JuliaEditorSupport / zed-julia

Julia support for Zed.
MIT License
44 stars 7 forks source link

Language server doesn't work: `server shut down` #4

Open whiterock opened 5 months ago

whiterock commented 5 months ago

I am on Zed 0.133.7 (622f0884d6e364deacdf31767632b29a5d216201). The extension version is v0.1.1

Apart from the syntax highlighting nothings work for me. Go to definition does nothing. All variables inside functions report "Julia: Missing reference: ", etc.

The following is a subset of the logs. (many more lines with identical error messages are present)

2024-05-21T13:48:38+02:00 [WARN] Generic lsp request to julia failed: server shut down 2024-05-21T13:48:38+02:00 [ERROR] crates/project/src/project.rs:6949: server shut down 2024-05-21T13:48:39+02:00 [ERROR] crates/editor/src/editor.rs:8417: failed to format via language server

Caused by: server shut down 2024-05-21T13:48:39+02:00 [ERROR] crates/project/src/project.rs:2710: sending into a closed channel

I have also installed the Julia Language Server (https://github.com/julia-vscode/LanguageServer.jl)

Are there any steps I have not followed here or could anyone provide me with "installation instructions" or the like?

Thanks in advance, whiterock

piechologist commented 5 months ago

You shouldn't need to install anything. This extension adds LanguageServer.jl to a new Julia environment zed-julia and starts it when you open a .jl file in Zed. Your .jl file must be in a local Julia package e.g., myproject/src/foo.jl and you need a myproject/Project.toml. So, just the basic stuff. There's not even anything we could configure.

Having said that, I've seen the LS crashing many times as well (just as in your post). Sometimes you can restart it with the Zed command restart language server.

christiankral commented 3 months ago

You shouldn't need to install anything. This extension adds LanguageServer.jl to a new Julia environment zed-julia and starts it when you open a .jl file in Zed. Your .jl file must be in a local Julia package e.g., myproject/src/foo.jl and you need a myproject/Project.toml. So, just the basic stuff. There's not even anything we could configure.

On my opinion it does also make sense to support standalone Julia files without a strict project structure. I am using a lot of such files to evaluate data in the devlopement process before completing a project.

However, I do understand that package version dependency can only be maintained by a full Julia project structure. Yet, most of the my Julia files (under development) I use, work with the latest version of the used packages. I am thus wondering if zed-julia could also support standalone files, as the package (but not version) dependencies are specified by using.