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

fix: make rust-analyzer could auto start #964

Closed
wants to merge 2 commits into from

Conversation

ClSlaid
Copy link
Contributor

@ClSlaid ClSlaid commented Aug 18, 2023

@ayamir
Copy link
Owner

ayamir commented Aug 18, 2023

Does this issue really exist? My rust-analyzer can start automatically when I nvim main.rs.

@ClSlaid
Copy link
Contributor Author

ClSlaid commented Aug 19, 2023

Does this issue really exist? My rust-analyzer can start automatically when I nvim main.rs.

If your rust-analyzer is not installed from mason, but from rustup, package managers or other sources, it will not automatically start and attach.

@Jint-lzxy
Copy link
Collaborator

I'm a bit dubious about whether this PR really fixes the problem. AFAIU it's possible that the FileType event is triggered after the server(s) get attached, so the (newly) registered server isn't spawned by lspconfig automatically. Maybe a better solution is to explicitly tell lspconfig to load the new schema after rust-tools completes its startup (just blindly guessing, haven't verified this yet).

@ayamir
Copy link
Owner

ayamir commented Aug 31, 2023

I'm a bit dubious about whether this PR really fixes the problem.

No, it doesn't work for me though the rust-analyzer installed from rustup and it can be found in my PATH. Close it.
The best way to avoid it is install it by mason.

@ayamir ayamir closed this Aug 31, 2023
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

Successfully merging this pull request may close these issues.

3 participants