zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48k stars 2.83k forks source link

Support standalone Rust files #5159

Open superyuuki opened 1 year ago

superyuuki commented 1 year ago

Check for existing issues

Is your feature request related to a problem?

Despite being written in Rust, Zed doesn't have first class support for the language (I don't think there is a language server integrated?)

Describe the solution you'd like

Integrate a rust language server

If applicable, add mockups / screenshots to help present your vision of the feature

N/A

aleksrutins commented 1 year ago

Zed has great Rust support, in my experience. What issue are you having?

mikayla-maki commented 1 year ago

Huh? We use RA everyday.

JosephTLyons commented 1 year ago

Sounds like you are having an issue @superyuuki.

Are you trying to open a single Rust file in Zed? Rust Analyzer doesn't work unless you are in an actual Rust project.

If that isn't the case, could you explain the setup of the project you are trying to view? Also, check the error log and and search for any rust analyzer related errors.

Also, feel free to join our Discord server to get more real-time support with this issue. You can find the link to the Discord server at:

Zed.dev -> Docs -> Giving Feedback -> Discord (requires being signed in)

superyuuki commented 1 year ago

Huh, that's odd! I wasa editing a single rust file, so that's likely the cause of the issue. I'll try opening a full project, in the meantime i have to ask if you plan to add support for single file projects?

JosephTLyons commented 1 year ago

We rely on the language server, which is built by the Rust team:

https://github.com/rust-lang/rust-analyzer

Whatever limitations they have, we have. If they ever support a single-file experience, then Zed should be able to too. Rust Analyzer is the standard for VS Code and Sublime as well. JetBrains IDEs are probably using their own tools to analyzed Rust code.

JosephTLyons commented 1 year ago

Someone mentioned in our Discord server that RA does have some sort of support for the now. Seems like this flew under our radar.

https://github.com/rust-lang/rust-analyzer/pull/8955

Will keep this open for the team to check out

diktomat commented 1 year ago

rust-tools.nvim seems to handle standalone files by just setting the root dir to the dir the file is in and setting a detachedFiles option: standalone.lua.