vscode-rust
vscode-rust copied to clipboard
Autocomplete causes Inconsistent Behavior on macOS
See screenshot below.
When attempting to call a function or member variable of a type, whether defined by an external crate(such as sdl2 in the below screenshot), or even a std::vec, no function signatures appear.
This occurs with "Racer: on" on the bottom left, and "Rust source" on the bottom right, so the obvious candidates are ruled out. My Rust Source setting is pointing to the correct directory, and all the binary files are being correctly pointed to.
If this issue is filed in error, please let me know what steps may be missing for a macOS user to get this setup.

Hi @Beamed, I cannot figure out what exactly in your opinion is a bug. There is no the bug in the issue's description. Could you write what you expect and what you get. Thanks
Sure, sorry for being unclear.
What I'm expecting is, when I attempt to make a call to a method, the function methods to appear when I press ".", and then as I type, filter down to the methods I'm attempting to call.
However, instead I don't see any methods appear. If I attempt to create or reference std:: functions or instantiate objects - such as vec - these stubs do correctly appear and fill. However, no function bodies appear for these, either.
I don't have access to my Linux or Windows box to report if I see these issues on those as well. Let me know what other information I can provide.
@Beamed, Let me check whether I understand you right. You write video You write . You expect appearing of autocompletion, but there is no autocompletion.
Is it right?
Write here version of SDL2 dependency you are using.
@Beamed,
Execute cargo build.
It should fail. It doesn't matter.
Try autocompletion again.
If it works, it is a racer specific.
EDIT: It doesn't work on Windows. I am going to fix it.
Okay. It is a bug of racer: https://github.com/phildawes/racer/issues/337
Keep the issue open until the bug of racer is fixed.
Thanks for your attention to this issue!
I agree that that above issue seems to be a racer bug. However, I am concerned that I see it with other, standard types as well.
For example, I see the following:
let mut myVec = vec![0, 1, 2];
myVec.
There is no autocomplete after pressing the '.' for the vector. I am new to Rust, so sorry if I betray a misunderstanding, but shouldn't functions such as pop, push, len, etc. appear as available?
@Beamed, Let me check whether it is a bug of the extension.
Oh. Right. I am from wrong computer. You can check it yourself. Open main.rs in the VSCode. Write
fn main() {
let mut myVec = vec![0, 1, 2];
myVec.
}
Place the cursor before . Remember line and column Open a terminal. Write:
racer complete <line> <column> <path/to/main.rs>
If the output is only
PREFIX ...
END ...
It is a bug of racer.
If some instruction is unclear let me know.
Yes, that is the only output. I see the following:
bash-3.2$ racer complete 3 10 ~/Projects/projname/projname/src/main.rs
PREFIX 57,57,
END
bash-3.2$
Does this indicate racer is unable to autocomplete on macOS at present? I will go review their issues page to see if they have an open issue as well.
@Beamed, It isn't a bug on MacOS. It is a bug in racer. The same behavior on all platforms. I know why it is. Change your example to
let mut myVec = Vec::new()
and
myVec. will trigger autocompletion.
No such luck:

Hm. I get autocompletion.
Which version of racer do you have? Try to upgrade it.
cargo install --force racer
$ racer --version
racer 2.0.2
Running the command to force racer to update brings it to 2.0.3. The vector autocomplete works, then! It must have been an issue specific to 2.0.2.
Thanks so much for your help!
Okay then. I close the issue since there is already opened issue related macros in racer.
Hm. I thought there was an opened issue, but it isn't.
@Beamed, I encourage you to try RLS. More information at https://github.com/KalitaAlexey/vscode-rust/pull/56 RLS autocompletes macros, and everything else.
Sorry I took so long to respond, was going through my issues - yes, RLS is working great! Thank you.
Do you want me to close this since I believe RLS is the implementation VSCode-Rust will use moving forward?
Don't close it please. People should know about existing problems.