Skip to content

rust-analyzer failing unexpectedly #61

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

Closed
computermouth opened this issue Dec 12, 2024 · 6 comments
Closed

rust-analyzer failing unexpectedly #61

computermouth opened this issue Dec 12, 2024 · 6 comments

Comments

@computermouth
Copy link

2024-12-12--1734022980_604x131_scrot

I use rust-analyzer at work. I set the global setting for use_without_project. I also enabled every setting I could find in terms of logging, and this is really all that comes out of it.

Just to see if the problem was actually with rust-analyzer, I also tried gopls with the same options, and that worked fine.

@techee
Copy link
Owner

techee commented Dec 12, 2024

I use rust-analyzer at work. I set the global setting for use_without_project.

Rust needs the information where the root of the project is. This can be achieved in two ways:

  1. By creating a Geany project and setting it's base path to the root of the project
  2. If you useuse_without_project, you must tell the plugin how to detect root directory of projects implicitly. This is what project_root_marker_patterns is good for - when you set it for instance to .git the plugin will go up in the directory structure from the opened file and if some directory contains .git, it will be considered to be the root of the project.

Only languages like Python work without specifying root of the project under the condition that the python script is just a single file containing all the code.

I also enabled every setting I could find in terms of logging, and this is really all that comes out of it.

By the way, the extra logs are shown in the terminal when you launch Geany from it, not in the messages window (when you enable full logging, the result is just too verbose to be displayed in the message window).

@computermouth
Copy link
Author

computermouth commented Dec 12, 2024

I've tried Cargo.toml Cargo.lock and .git, which are all at the directory root, and saw no change.

the extra logs are shown in the terminal when you launch Geany from it

Got it, the error message is:

error: Unknown binary 'rust-analyzer' in official toolchain 'stable-x86_64-unknown-linux-gnu'.

full output here

@techee
Copy link
Owner

techee commented Dec 12, 2024

No idea what this particular message means but:

  1. Would you try to use full path in the cmd= configuration
  2. And before that, try to run this command from the terminal. If rust-analyzer works, it should just block when you start it (you can then terminate it with Ctrl+C)

@techee
Copy link
Owner

techee commented Dec 12, 2024

Sounds like this

rust-lang/rustup#3846

If you really have 2 rust-analyzer versions installed like in this issue, absolute path to the correct version should solve it.

@computermouth
Copy link
Author

rust-lang/rustup#3846

Yeah that was it, weird. I got the same error just running it from my terminal, but after deleting, and reinstalling via rustup, it worked fine.

Sorry to bombard you with user-error issues today. Thanks so much for building this plugin, is there anywhere I can donate to or sponsor your work?

@techee
Copy link
Owner

techee commented Dec 12, 2024

Good to hear. If you run into any other problems, just let me know.

@techee techee closed this as completed Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants