Comments (10)
I fixed this; it was indeed not a problem with coc or coc-rls. Turns out an old script was being sourced that set RUST_SRC_PATH
to an invalid value; apparently VS Code ignores this variable or handles it being incorrect. Sorry for the trouble and thank you for the help!
from coc-rls.
Try add "rust-client.channel": "stable",
in your coc-settings.json
, don't know why nightly is broken for me.
from coc-rls.
Hmm, unfortunately that changes nothing. Explicitly setting nightly
also has no effect (though that's more expected).
I'm testing this using a new project (e.g. cargo new coc-rls-test
) and editing src/main.rs
. I'm on Arch Linux; rls --version
is "rls-preview 1.33.0 (9f3c906 2019-01-20)".
from coc-rls.
Don't know what happened, consider check out output channel of rust.
from coc-rls.
In the process of constructing
use std::thread;
use std::collections::HashMap;
fn main() {
println!("Hello, world!");
}
from the main.rs
created by cargo new
, I get the following output:
## Output channel: rust
error: expected identifier, found keyword `fn`
--> <racer-file>:2:1
|
2 | fn main() {
| ^^ expected identifier, found keyword
error: expected one of `::`, `;`, or `as`, found `main`
--> <racer-file>:2:4
|
2 | fn main() {
| ^^^^ expected one of `::`, `;`, or `as` here
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:2:1
|
1 | use s
| - expected one of `::`, `;`, or `as` here
2 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:2:1
|
1 | use std
| - expected one of `::`, `;`, or `as` here
2 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `:`
--> <racer-file>:1:8
|
1 | use std:
| ^ expected one of `::`, `;`, or `as` here
error: expected identifier, found keyword `fn`
--> <racer-file>:2:1
|
2 | fn main() {
| ^^ expected identifier, found keyword
error: expected one of `::`, `;`, or `as`, found `main`
--> <racer-file>:2:4
|
2 | fn main() {
| ^^^^ expected one of `::`, `;`, or `as` here
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:2:1
|
1 | use std::t
| - expected one of `::`, `;`, or `as` here
2 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:2:1
|
1 | use std::thr
| - expected one of `::`, `;`, or `as` here
2 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:2:1
|
1 | use std::threa
| - expected one of `::`, `;`, or `as` here
2 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use s
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `:`
--> <racer-file>:1:8
|
1 | use std:
| ^ expected one of `::`, `;`, or `as` here
error: expected one of `::`, `;`, or `as`, found `:`
--> <racer-file>:1:8
|
1 | use std:
| ^ expected one of `::`, `;`, or `as` here
error: expected identifier, found keyword `fn`
--> <racer-file>:3:1
|
3 | fn main() {
| ^^ expected identifier, found keyword
error: expected one of `::`, `;`, or `as`, found `main`
--> <racer-file>:3:4
|
3 | fn main() {
| ^^^^ expected one of `::`, `;`, or `as` here
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::c
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::col
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::colle
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::collect
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::collection
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `:`
--> <racer-file>:1:21
|
1 | use std::collections:
| ^ expected one of `::`, `;`, or `as` here
error: expected identifier, found keyword `fn`
--> <racer-file>:3:1
|
3 | fn main() {
| ^^ expected identifier, found keyword
error: expected one of `::`, `;`, or `as`, found `main`
--> <racer-file>:3:4
|
3 | fn main() {
| ^^^^ expected one of `::`, `;`, or `as` here
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::collections::H
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::collections::Hash
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
error: expected one of `::`, `;`, or `as`, found `fn`
--> <racer-file>:3:1
|
1 | use std::collections::HashMa
| - expected one of `::`, `;`, or `as` here
2 |
3 | fn main() {
| ^^ unexpected token
It seems like RLS is failing to parse the file, maybe? Though this doesn't happen in VSCode, so I don't think it's a RLS error.
The relevant part of my VS Code config is:
"rust.all_features": true,
"rust.rustup": {
"toolchain": "stable-x86_64-unknown-linux-gnu",
"nightlyToolchain": "nightly-x86_64-unknown-linux-gnu"
},
"rust.mode": "rls",
"rust.rls": {
"useRustfmt": true
}
from coc-rls.
@chemzqm: Just to confirm, you do get completion in the example I gave? And your rls
version and coc config is the same as what I listed?
from coc-rls.
Sure, I only have those
"rust.trace.server": "verbose",
"rust-client.channel": "stable",
for coc-rls in my settings file.
Looks like the server have trouble parsing your file, so it doesn't provide any completion.
from coc-rls.
from coc-rls.
That is bizarre. With the exact same file you're editing and the example config from the coc.nvim
README (with the rust-related settings you mention above added), I get nothing for completions on items in std
, but do with VS Code (also using RLS).
Looking at the verbose server output, as above there are lots of errors about failing to parse the file, and the result of completion requests is always []
. But only for completion requests on std
items; items from 3rd party libraries succeed correctly. I'm very confused by this...
What does rls --version
output for you? What Neovim version are you using?
from coc-rls.
Hmm. I just tried the same example using LCN and ncm2, and have the same symptoms. Although I've still no idea what's causing this bug, that seems to imply it isn't a problem with coc-rls
, at least? As such, I'll close this issue. Thanks for the help!
from coc-rls.
Related Issues (20)
- coc-implementation doesn't work HOT 1
- Nix + macOS makes RLS fail to build HOT 1
- Suppress startup message HOT 3
- CocAction('format') using 2 spaces instead of 4 HOT 6
- Option to not to ask to install RLS? HOT 4
- rls doesnt start under cygwin vim HOT 3
- "Run Test" code lens issues bare "cargo run"
- Go to definition not working for rust stdlib HOT 2
- Fix prefix for coc-settings in the README
- Cant get autocompletion HOT 2
- NeoVim crashing on auto complete HOT 1
- Question: Is rust-analyzer engine supported? HOT 2
- Doesn't install (Timeout) HOT 1
- Conflict with existing keybindings in init.vim HOT 2
- Wondering how to activate this feature?
- Async and detect slow HOT 1
- coc-rls installation/usage without rustup? HOT 2
- how can I set tab width? HOT 1
- How to disable expandtab feature? HOT 1
- The last component of the type is always missing in floating window. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coc-rls.