-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Doom Emacs code suggestions do not work for std, works for rls #11580
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
Comments
Is there any output in the |
Similar issue here with the upgrade to the latest:
and plain
There is nothing
|
Do you get completions for e.g. local variables? You only mentioned snippets. |
Normal output does not affect use |
Nothing in rust-analyzer: stderr.
|
no, only keywords and snippets |
Can you show an example of the completions you're getting? Also it'd be interesting to do |
also here is the result from |
What does running |
|
I also installed toolchain nightly, installed rust-src and clippy for it, |
wait a sec. this has something to do with rustlings. If I do |
Yeah, Rustlings has a weird project structure, it doesn't work very well with RA (and had trouble with RLS in the past, I think). |
sorry about that then. And thanks for your time and help. |
There's a PR that generates a rust-analyzer project file for rustlings. |
You can do this to fix your project to work with rust analyzer until that PR is merged: # Install rustlings-fix from cargo
cargo install rustlings-fix
# Change directory into wherever rustlings is cloned
cd ~/src/rustlings
# Run the binary
rustlings-fix |
works like a charm. you guys are awesome! thanks but now I have to learn some rust then instead of playing around with emacs all day long... :D |
rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
dev-util/rust-analyzer
Latest version available: 20220222
Latest version installed: 20220222
Size of files: 33.387 KiB
Homepage: https://rust-analyzer.github.io
Description: An implementation of Language Server Protocol for the Rust programming language
License: 0BSD Apache-2.0 Artistic-2 BSD Boost-1.0 CC0-1.0 ISC MIT Unlicense ZLIB
rustc version: (eg. output of
rustc -V
)rustc 1.58.1-nightly (gentoo)
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTUP_HOME
orCARGO_HOME
)which rustc
/usr/bin/rustc
which cargo
/usr/bin/cargo
Steps to reproduce:
~/.emacs.d/bin/doom install
(setq rustic-lsp-server 'rust-analyzer)) into ~/.doom.d/config.el so rust-analyzer is loaded instead of rls when opening a .rs
So I do not get code suggestions from company-mode for std things. It works for code snippets like fn, if etc.
I tried changing RUST_SRC_PATH to
/usr/lib/rust/1.58.1/lib/rustlib/src/rust/library/
and/usr/lib/rust/1.58.1/lib/rustlib/src/rust/src
via export in zsh, then doing the~/.emacs.d/bin/doom env
dance to have this environment variable in doom emacs as well. The environment variable exists in ~/.emacs.d/.local/env.In the minibuffer it says
LSP :: Error from the Language Server: waiting for cargo metadata or cargo check (Unknown error) [2 times]
The text was updated successfully, but these errors were encountered: