vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

Autocomplete causes Inconsistent Behavior on macOS

Open LadyRadia opened this issue 8 years ago • 22 comments

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.

image

LadyRadia avatar Dec 28 '16 03:12 LadyRadia

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

KalitaAlexey avatar Dec 28 '16 05:12 KalitaAlexey

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.

LadyRadia avatar Dec 28 '16 05:12 LadyRadia

@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.

KalitaAlexey avatar Dec 28 '16 06:12 KalitaAlexey

@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.

KalitaAlexey avatar Dec 28 '16 09:12 KalitaAlexey

Okay. It is a bug of racer: https://github.com/phildawes/racer/issues/337

KalitaAlexey avatar Dec 28 '16 14:12 KalitaAlexey

Keep the issue open until the bug of racer is fixed.

KalitaAlexey avatar Dec 28 '16 14:12 KalitaAlexey

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?

LadyRadia avatar Dec 28 '16 17:12 LadyRadia

@Beamed, Let me check whether it is a bug of the extension.

KalitaAlexey avatar Dec 28 '16 17:12 KalitaAlexey

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.

KalitaAlexey avatar Dec 28 '16 17:12 KalitaAlexey

If some instruction is unclear let me know.

KalitaAlexey avatar Dec 28 '16 17:12 KalitaAlexey

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.

LadyRadia avatar Dec 28 '16 18:12 LadyRadia

@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.

KalitaAlexey avatar Dec 28 '16 18:12 KalitaAlexey

No such luck: image

LadyRadia avatar Dec 28 '16 18:12 LadyRadia

Hm. I get autocompletion.

KalitaAlexey avatar Dec 28 '16 18:12 KalitaAlexey

Which version of racer do you have? Try to upgrade it.

cargo install --force racer

KalitaAlexey avatar Dec 28 '16 18:12 KalitaAlexey

$ 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!

LadyRadia avatar Dec 28 '16 19:12 LadyRadia

Okay then. I close the issue since there is already opened issue related macros in racer.

KalitaAlexey avatar Dec 28 '16 19:12 KalitaAlexey

Hm. I thought there was an opened issue, but it isn't.

KalitaAlexey avatar Dec 29 '16 07:12 KalitaAlexey

@Beamed, I encourage you to try RLS. More information at https://github.com/KalitaAlexey/vscode-rust/pull/56 RLS autocompletes macros, and everything else.

KalitaAlexey avatar Feb 07 '17 17:02 KalitaAlexey

Sorry I took so long to respond, was going through my issues - yes, RLS is working great! Thank you.

LadyRadia avatar Jul 31 '17 04:07 LadyRadia

Do you want me to close this since I believe RLS is the implementation VSCode-Rust will use moving forward?

LadyRadia avatar Jul 31 '17 04:07 LadyRadia

Don't close it please. People should know about existing problems.

KalitaAlexey avatar Aug 01 '17 02:08 KalitaAlexey