Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Rust LSP not working #6526

Closed
the-ssd opened this issue Apr 1, 2023 · 1 comment
Closed

Rust LSP not working #6526

the-ssd opened this issue Apr 1, 2023 · 1 comment
Labels
C-bug Category: This is a bug

Comments

@the-ssd
Copy link

the-ssd commented Apr 1, 2023

Summary

lsp for rust doesn't work
this also happens when you run 'rust-analyzer' but not when running 'rls'
error when running rust-analyzer

error: unknown proxy name: 'rust-analyzer'; valid proxy names are 'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'

error is similar to the error in the log

Reproduction Steps

I tried this:

  1. update with rustup
  2. update system

I expected this to happen:
working lsp

Instead, this happened:
only grammar is working

Helix log

~/.cache/helix/helix.log
2023-04-01T09:20:39.025 helix_loader [DEBUG] Located configuration folders: []
2023-04-01T09:20:39.036 helix_view::clipboard [INFO] Using xclip to interact with the system and selection (primary) clipboard
2023-04-01T09:20:39.106 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline">
2023-04-01T09:20:39.107 helix_view::editor [DEBUG] editor status: Loaded 1 files.
2023-04-01T09:20:39.108 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-04-01T09:20:39.110 helix_lsp::transport [ERROR] err <- "error: unknown proxy name: 'rust-analyzer'; valid proxy names are 'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-f>
2023-04-01T09:20:39.111 helix_lsp [ERROR] failed to initialize language server: server closed the stream
2023-04-01T09:20:39.111 helix_lsp::transport [ERROR] err: <- StreamClosed
2023-04-01T09:20:39.115 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: None, method: "exit", params: None })))
2023-04-01T09:20:39.115 helix_view::editor [DEBUG] editor status: Language server exited

Platform

Linux Opensuse

Terminal Emulator

Konsole

Helix Version

helix 22.12

@the-ssd the-ssd added the C-bug Category: This is a bug label Apr 1, 2023
@David-Else
Copy link
Contributor

Try this, get rid of any old versions of rust analyzer that might be hanging around first:

#!/bin/bash

bin_install_folder=/usr/local/bin # wherever you usually store your binary files, must be able to run from the terminal and be in the $PATH
rustup component add rust-analyzer
sudo ln -s "$(rustup which rust-analyzer)" $bin_install_folder/rust-analyzer

Rustup is going to fix this problem in the next release:

rust-lang/rustup#3022 (comment)

@pascalkuthe pascalkuthe converted this issue into discussion #6599 Apr 5, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants