rls
rls copied to clipboard
[regression] `can't find crate` when crate is referred to via relative path (in a workspace)
This is a regression from rls 1.34.0 (0d6f53e 2019-02-14)
- normal
cargo build
works fine - older versions of
rls
do not have the problem
How to repro from https://github.com/itadinanta/ofx-rs/tree/tags/rls_1409_cant_find_crate (requires nightly-2019-03-23)
git clone https://github.com/itadinanta/ofx-rs.git
cd ofx-rs
git checkout tags/rls_1409_cant_find_crate
echo nightly-2019-03-23 > rust-toolchain
rls --cli
Bad build (rls 1.35.0 (90f7ab0 2019-03-17)
)
nico@devuan-3xS:~/Projects/itadinanta/ofx-rs$ rls --version
rls 1.35.0 (90f7ab0 2019-03-17)
nico@devuan-3xS:~/Projects/itadinanta/ofx-rs$ rls --cli
Initializing (look for `progress[done:true]` message)...
> 1: InitializeResult {
capabilities: ServerCapabilities {
text_document_sync: Some(
Kind(
Incremental
)
),
hover_provider: Some(
true
),
completion_provider: Some(
CompletionOptions {
resolve_provider: Some(
true
),
trigger_characters: Some(
[
".",
":"
]
)
}
),
signature_help_provider: None,
definition_provider: Some(
true
),
type_definition_provider: None,
implementation_provider: Some(
Simple(
true
)
),
references_provider: Some(
true
),
document_highlight_provider: Some(
true
),
document_symbol_provider: Some(
true
),
workspace_symbol_provider: Some(
true
),
code_action_provider: Some(
Simple(
true
)
),
code_lens_provider: Some(
CodeLensOptions {
resolve_provider: Some(
false
)
}
),
document_formatting_provider: Some(
true
),
document_range_formatting_provider: Some(
false
),
document_on_type_formatting_provider: None,
rename_provider: Some(
Simple(
true
)
),
color_provider: None,
folding_range_provider: None,
execute_command_provider: Some(
ExecuteCommandOptions {
commands: [
"rls.applySuggestion-2336",
"rls.deglobImports-2336"
]
}
),
workspace: None
}
}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx cfg(test)","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"build_script_main","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx_rs_basic","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx_rs_basic cfg(test)","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_1","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_0","title":"Indexing"}}
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"E0463","message":"can't find crate for `ofx`\n\ncan't find crate","range":{"end":{"character":17,"line":2},"start":{"character":0,"line":2}},"severity":1,"source":"rustc"}],"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/examples/basic/src/lib.rs"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_0","title":"Indexing"}}
Good build (rls 1.34.0 (0d6f53e 2019-02-14)
)
nico@devuan-3xS:~/Projects/itadinanta/ofx-rs$ rls --version
rls 1.34.0 (0d6f53e 2019-02-14)
nico@devuan-3xS:~/Projects/itadinanta/ofx-rs$ rls --cli
Initializing (look for `progress[done:true]` message)...
> 1: InitializeResult {
capabilities: ServerCapabilities {
text_document_sync: Some(
Kind(
Incremental
)
),
hover_provider: Some(
true
),
completion_provider: Some(
CompletionOptions {
resolve_provider: Some(
true
),
trigger_characters: Some(
[
".",
":"
]
)
}
),
signature_help_provider: None,
definition_provider: Some(
true
),
type_definition_provider: None,
implementation_provider: Some(
Simple(
true
)
),
references_provider: Some(
true
),
document_highlight_provider: Some(
true
),
document_symbol_provider: Some(
true
),
workspace_symbol_provider: Some(
true
),
code_action_provider: Some(
Simple(
true
)
),
code_lens_provider: Some(
CodeLensOptions {
resolve_provider: Some(
false
)
}
),
document_formatting_provider: Some(
true
),
document_range_formatting_provider: Some(
false
),
document_on_type_formatting_provider: None,
rename_provider: Some(
Simple(
true
)
),
color_provider: None,
folding_range_provider: None,
execute_command_provider: Some(
ExecuteCommandOptions {
commands: [
"rls.applySuggestion-2163",
"rls.deglobImports-2163"
]
}
),
workspace: None
}
}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"build_script_main","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx cfg(test)","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx_rs_basic","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx_rs_basic cfg(test)","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx_sys cfg(test)","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"ofx_sys","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_1","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_0","title":"Indexing"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_0","title":"Indexing"}}
Additional information:
Changing ofx = { path = "../../ofx" }
to ofx = { path = "../ofx" }
fixes the problem in rls
but then cargo build
fails.
Still open as for rls 1.35.0 (b202e14 2019-04-11)
UPDATE: it doesn't happen 100%. Occasionally, RLS succeeds. I haven't pinpointed which are the success conditions though.
For me this doesn't happen on 1.35 but happens on 1.36+, see this comment: https://github.com/rust-lang/rls-vscode/issues/579#issuecomment-496208713
Still open as for rls 1.37.0 (124483d 2019-07-01)
I am still unable to use RLS on https://github.com/itadinanta/ofx-rs
rls
as of today is still rls 1.37.0 (124483d 2019-07-01)
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"renamed_and_removed_lints","message":"lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`\n\nnote: #[warn(renamed_and_removed_lints)] on by default\nhelp: use the new name: `clippy::redundant_static_lifetimes`","range":{"end":{"character":38,"line":3},"start":{"character":9,"line":3}},"severity":2,"source":"rustc"},{"code":"renamed_and_removed_lints","message":"lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`\n\nhelp: use the new name: `clippy::redundant_static_lifetimes`","range":{"end":{"character":38,"line":3},"start":{"character":9,"line":3}},"severity":2,"source":"rustc"}],"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx-sys/src/lib.rs"}}
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"E0463","message":"can't find crate for `ofx`\n\ncan't find crate","range":{"end":{"character":17,"line":2},"start":{"character":0,"line":2}},"severity":1,"source":"rustc"}],"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/examples/basic/src/lib.rs"}}
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"bare_trait_objects","message":"trait objects without an explicit `dyn` are deprecated\n\nnote: #[warn(bare_trait_objects)] on by default\nhelp: use `dyn`: `dyn Execute`","range":{"end":{"character":22,"line":87},"start":{"character":15,"line":87}},"severity":2,"source":"rustc"},{"code":"bare_trait_objects","message":"trait objects without an explicit `dyn` are deprecated\n\nhelp: use `dyn`: `dyn Execute`","range":{"end":{"character":23,"line":308},"start":{"character":16,"line":308}},"severity":2,"source":"rustc"}],"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/plugin.rs"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_0","message":null,"percentage":null,"title":"Indexing"}}
cargo build
succeeds.
I'm seeing this issue with on rust 1.36.0 on https://github.com/CraneStation/wasmtime. Pinning to rust 1.35.0 works around the issue. I'm not comfortable with this workaround though since this project progresses quite fast and will surely surpass 1.35.0 anytime soon.
EDIT: I was wrong about 1.35.0 working. Code formatting seems to be broken between vscode and rls with that version on that project.
Is anyone actively working on this issue?
Still open as of rls 1.38.0 (496c892 2019-08-12)
Getting hit by this too :(
Also having this issue with rls 1.38.0 (7b0a20b 2019-08-11)
Still open as of rls 1.41.0 (b27e117 2020-01-13)