Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code completion error #16

Open
alexreg opened this issue Dec 27, 2015 · 9 comments
Open

Code completion error #16

alexreg opened this issue Dec 27, 2015 · 9 comments

Comments

@alexreg
Copy link

alexreg commented Dec 27, 2015

I press the shortcut for code completion (by the way, why isn't it something simpler like Tab?) and TextMate freezes up for about 60 seconds, then gives me the following error message:

Failure running “Complete”.
/usr/local/bin/multirust: fork: Resource temporarily unavailable
multirust: assert_nz multirust_dir
Complete:31: undefined method `exit_show_tool_tip' for TextMate:Module (NoMethodError)

What's going on here?

NB: my environment consists of a simple script /usr/local/bin/racer which contains:

#!/bin/bash

multirust run override racer "$@"

This runs fine from the command line.

@carols10cents
Copy link
Owner

I press the shortcut for code completion (by the way, why isn't it something simpler like Tab?)

I'm not sure, you'll have to ask the Textmate developers that -- all Textmate bundles use esc for completion.

Have you set the RUST_SRC_PATH variable in your textmate preferences?

I've been meaning to set up multirust anyway, I'll see if I can reproduce.

@alexreg
Copy link
Author

alexreg commented Dec 29, 2015

Fair enough. It seems to be Alt+Esc on my system.

Yeah, do please let me know how it works for you, with multirust.

On 29 Dec 2015, at 01:34, Carol (Nichols || Goulding) [email protected] wrote:

I press the shortcut for code completion (by the way, why isn't it something simpler like Tab?)

I'm not sure, you'll have to ask the Textmate developers that -- all Textmate bundles use esc for completion http://manual.macromates.com/en/working_with_text#completion.

Have you set the RUST_SRC_PATH variable in your textmate preferences?

I've been meaning to set up multirust anyway, I'll see if I can reproduce.


Reply to this email directly or view it on GitHub #16 (comment).

@infininight
Copy link
Contributor

@alexreg The tab key can't be used for completion because it triggers snippets and of course inserting a tab character. Escape was chosen as the next best for completion, and option-escape is the secondary if two completion commands need to exist simultaneously.

@alexreg
Copy link
Author

alexreg commented Dec 29, 2015

That’s fair enough, I suppose. Other editors (e.g. Visual Studio) manage to differentiation indentation tabs from tab-completion tabs, but the snippets feature does complicate things.

On 29 Dec 2015, at 04:08, Michael Sheets [email protected] wrote:

@alexreg https://github.com/alexreg The tab key can't be used for completion because it triggers snippets and of course inserting a tab character. Escape was chosen as the next best for completion, and option-escape is the secondary if two completion commands need to exist simultaneously.


Reply to this email directly or view it on GitHub #16 (comment).

@carols10cents
Copy link
Owner

Hi @alexreg, I'm sorry I've taken so long to dig into this. I'm able to get the hanging behavior you describe using only the command line, without textmate... could you take a look at what I'm doing and let me know if you can reproduce what I'm seeing, and if not, what is different between your environment and mine?

I have this multirust installed:

$ multirust --version
multirust 0.7.0 (f3974f2b9 2015-12-14 14:49:29 +0000)

I have the rust source in /Users/carolnichols/rust/rust/src and RUST_SRC_PATH set in my terminal env:

$ echo $RUST_SRC_PATH
/Users/carolnichols/rust/rust/src

I used cargo install in multirust beta to install racer:

$ multirust run beta cargo install racer
...
$ which racer
/Users/carolnichols/.multirust/toolchains/beta/cargo/bin/racer

I can get some completions from racer on the command line directly using multirust run override at this point:

$ multirust run override racer complete std::io::B
MATCH BufReader,47,11,/Users/carolnichols/rust/rust/src/libstd/io/buffered.rs,Struct,pub struct BufReader<R> {
MATCH BufWriter,299,11,/Users/carolnichols/rust/rust/src/libstd/io/buffered.rs,Struct,pub struct BufWriter<W: Write> {
MATCH BufRead,1252,10,/Users/carolnichols/rust/rust/src/libstd/io/mod.rs,Trait,pub trait BufRead: Read {
MATCH Broadcast,1479,11,/Users/carolnichols/rust/rust/src/libstd/io/mod.rs,Struct,pub struct Broadcast<T, U> {
MATCH Bytes,1612,11,/Users/carolnichols/rust/rust/src/libstd/io/mod.rs,Struct,pub struct Bytes<R> {

Then I put your script on my path, with the name script-racer for the moment:

$ which script-racer
/Users/carolnichols/bin/script-racer
$ cat /Users/carolnichols/bin/script-racer
#!/bin/bash

multirust run override racer "$@"

And I can run that and get completions:

$ script-racer complete std::io::B
MATCH BufReader,47,11,/Users/carolnichols/rust/rust/src/libstd/io/buffered.rs,Struct,pub struct BufReader<R> {
MATCH BufWriter,299,11,/Users/carolnichols/rust/rust/src/libstd/io/buffered.rs,Struct,pub struct BufWriter<W: Write> {
MATCH BufRead,1252,10,/Users/carolnichols/rust/rust/src/libstd/io/mod.rs,Trait,pub trait BufRead: Read {
MATCH Broadcast,1479,11,/Users/carolnichols/rust/rust/src/libstd/io/mod.rs,Struct,pub struct Broadcast<T, U> {
MATCH Bytes,1612,11,/Users/carolnichols/rust/rust/src/libstd/io/mod.rs,Struct,pub struct Bytes<R> {

As soon as I move your script from script-racer to just racer, however, running racer from the command line hangs for me:

$ mv ~/bin/script-racer ~/bin/racer
$ which racer
/Users/carolnichols/bin/racer
$ racer complete std::io::B
[hangs forever]

Perhaps the script is calling itself?

@alexreg
Copy link
Author

alexreg commented Jan 25, 2016

Thanks for the reply, @carols10cents.

I just tried this again and completion seems to work fine when I press Esc, but freezes when I press Alt+Esc (I then have to press Ctrl+C to unfreeze, i.e. cancel the shell script).

I'm not getting the hanging behaviour from the command line, although the script on my system is /usr/local/bin/racer.

@alexreg
Copy link
Author

alexreg commented May 21, 2017

Hi @carols10cents. Any update on this? Has the project been abandoned, perhaps?

@carols10cents
Copy link
Owner

Nope, it's not abandoned, I just haven't had time to spend on this lately. Feel free to fork and improve if you want though!

@alexreg
Copy link
Author

alexreg commented May 22, 2017

No worries. I don't have the time either, I'm afraid. But I'd be happy to test updates. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants