rust-lang / rls

Repository for the Rust Language Server (aka RLS)
Other
3.51k stars 257 forks source link

not compatiable with neon projects #1427

Open calidion opened 5 years ago

calidion commented 5 years ago

Last command:

Racer Output: RUST_SRC_PATH environment variable must be set to point to the src directory of a rust checkout. E.g. "/home/foouser/src/rust/src" Racer Error:

norru commented 5 years ago

This Neon? https://github.com/neon-bindings/neon

calidion commented 5 years ago

yes.

norru commented 5 years ago

Hi @calidion, do you mind posting some context to the error message?

Quick question: jave you installed rls and and rust with the required components via rustup?

rustup update
rustup component add rls-preview rust-analysis rust-src

from https://github.com/eclipse/corrosion/blob/master/documentation/Troubleshooting.md

calidion commented 5 years ago

It is very obvious on vscode. neon project moves rust code into dir native, so it is not inside the root directory of the project.

you can checkout my source here: https://github.com/vigcoin/neon or create a new neon project and edit it with vscode.

norru commented 5 years ago

@calidion I did try briefly rls --cli on your repo and wasn't able to reproduce your error. Will try in IDE (Eclipse Corrosion) later.

calidion commented 5 years ago
{"jsonrpc":"2.0","method":"window/showMessage","params":{"message":"could not find `Cargo.toml` in `/home/eric/vigcoin/neon-vigcoin` or any parent directory","type":1}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_0","message":null,"percentage":null,"title":"Indexing"}}
calidion commented 5 years ago

2019-05-01 12-37-05屏幕截图

calidion commented 5 years ago

I use vscode with rls extenstion.

norru commented 5 years ago

Hi @calidion

I did try your project on Eclipse. You may extrapolate for VSC.

Using neon\native as the project's root works.

Using neon as the project root doesn't work - As there is no Cargo.toml in the root of the project, Eclipse does not recognize it as a rust project.

I believe this behaviour is as intended.

If it's not too big a problem you could try placing a Cargo.toml containing a [workspace] section in the root of your neon project.

https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html