defuz / RustAutoComplete

A SublimeText binding for RACER (Rust auto completion tool)
MIT License
105 stars 20 forks source link

auto_complete_triggers not working #41

Open luisfernrg opened 7 years ago

luisfernrg commented 7 years ago

This is my config file

{
    // The full path to the racer binary. If racer is already
    // in your system path, then this default will be fine.
    "racer": "/Users/luis/.cargo/bin/racer",

    // A list of search paths. This should generally just
    // be the path to the rust compiler src/ directory.
    "search_paths": [
      "/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src"
    ]
}

every time I writing something

use std::

I get no hints or suggestions. Is there anything wrong in my config file or that i can add/edit to make this work?

daboross commented 7 years ago

This is working correctly for me on linux, there are a few things you may want to try:

First, are there any obvious errors in the sublime text console? It can be shown from View->Show Console, and it will contain the output of any failed racer command calls.

Second, just to make sure, did you install the source? This might be obvious, but rustup no longer installs source files and std docs by default, it will just download the binaries to save on network bandwidth and storage space.

Third, I guess, what racer version are you running? It's working for me with version 2.0.6, if you have an earlier version than that you may want to uninstall/reinstall with cargo install to update.

luisfernrg commented 7 years ago

@daboross just check all three and everything is working racer isn't giving any errors, rust src is installed and I have the same racer version installed. What does your user config look by the way?

daboross commented 7 years ago
{
    // The full path to the racer binary. If racer is already
    // in your system path, then this default will be fine.
    "racer": "racer",

    // A list of search paths. This should generally just
    // be the path to the rust compiler src/ directory.
    "search_paths": [
        "/home/daboross/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    ]
}

This is my config, it seems to be working alright. using racer on the commandline also works. I'm using rustc 1.17.0-beta.3 and racer 2.0.6 compiled with that rust version.

luisfernrg commented 7 years ago

@daboross when I type something like this ill get the pop up showing String as an option use std::string::S

however I want to be able to type something like this and have all possible options for that to pop up use std::string::

is there a way to do this?

zatherz commented 6 years ago

Bump

daboross commented 6 years ago

Sorry I didn't reply to this - I completely thought that I'd put another message here...

@luisfernrg For me, RustAutoComplete does work like that. Right now I have rustc 1.23.0-nightly, and racer 2.0.10 installed.

screenshot from 2017-11-24 00-01-50

This... might just be an upgrade to racer though? I mean, I'm honestly not sure whether this worked with previous versions of racer or not. In any case, it does work the way you describe on my machine currently with the latest racer version.

Edit: My current config is:

{
    // The full path to the racer binary. If racer is already
    // in your system path, then this default will be fine.
    "racer": "racer",

    // A list of search paths. This should generally just
    // be the path to the rust compiler src/ directory.
    "search_paths": [
        "/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"
    ]
}

Edit: one other thing I forgot to mention... I'm using Sublime Text 3 for this - is there any possibility you're trying with ST2, and there's a difference there?

luisfernrg commented 6 years ago

@daboross I'm using the same version of racer and rustc but still no luck.

@zatherz are you also on Mac OS X

Edit: I'm also using Sublime Text 3

zatherz commented 6 years ago

I'm on Linux, Arch Linux to be more specific. Racer 2.0.12, Rust 1.21.0.

daboross commented 6 years ago

hm, that's strange - I mean, I'm tried this on both Gentoo and Ubuntu 17.10, and it's worked fine for me.

You're both using RustAutoComplete v0.9.0 installed via Package Control, right? (I checked via action "List Packages")

Does running racer complete std::string:: in a terminal work correctly for both of you? My output is below:

$ racer complete std::string::
MATCH String,294,11,/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct String
MATCH FromUtf8Error,335,11,/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct FromUtf8Error
MATCH FromUtf16Error,360,11,/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct FromUtf16Error(());
MATCH ParseError,1976,9,/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Enum,pub enum ParseError {}
MATCH ToString,2027,10,/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Trait,pub trait ToString
MATCH Drain,2200,11,/home/daboross/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct Drain<'a>
zatherz commented 6 years ago
$ racer complete std::string::
MATCH String,294,11,/home/zatherz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct String
MATCH FromUtf8Error,335,11,/home/zatherz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct FromUtf8Error
MATCH FromUtf16Error,360,11,/home/zatherz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct FromUtf16Error(());
MATCH ParseError,1976,9,/home/zatherz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Enum,pub enum ParseError {}
MATCH ToString,2027,10,/home/zatherz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Trait,pub trait ToString
MATCH Drain,2200,11,/home/zatherz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct Drain<'a>
luisfernrg commented 6 years ago

Yea I'm using v0.9.0 MATCH String,294,11,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct String MATCH FromUtf8Error,335,11,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct FromUtf8Error MATCH FromUtf16Error,360,11,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct FromUtf16Error(()); MATCH ParseError,1959,9,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Enum,pub enum ParseError {} MATCH ToString,2010,10,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Trait,pub trait ToString MATCH Drain,2183,11,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct Drain<'a> MATCH Splice,2254,11,/Users/luis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../liballoc/string.rs,Struct,pub struct Splice<'a, 'b>

daboross commented 6 years ago

Well, hm. I can't think of anything else that could be the problem.

If rustup sources and racer are both working fully correctly, and we all have the same versions of sublime text and RustAutoComplete, it should just work.

Hopefully if anyone with more knowledge of the plugin sees this, the information gathered can at least help a bit.