racer-rust / emacs-racer

Racer support for Emacs
399 stars 48 forks source link

Insert argument placeholders for function completions #106

Closed raketeneis closed 5 years ago

raketeneis commented 5 years ago

I tried my hand at issue #37. After completion, if the matchtype was a function, it tries to extract and insert the function arguments in the same way that was referenced in the issue. If there is a self argument in the beginning of the argument list, that one is not inserted.

I don't know much Emacs Lisp, so please let me know if there is a mistake or something I can improve.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.04%) to 63.333% when pulling 2360c2f3a5e70e2ea94a82552a8a1b0a07c99c49 on raketeneis:master into dd7f179efbab6597eb7eb1d66883f168b3dc5573 on racer-rust:master.

kngwyu commented 5 years ago

Thanks! I think it's great improvement, but I'm worrying about the case where racer doesn't return correct function signature. So I'm going to test this PR after checking racer definitely returns correct function signatures, or modifying it to do so. Sorry for delay :sweat:

raketeneis commented 5 years ago

I just spotted two basic mistakes:

I fixed these now, though I should have been more thorough before submitting the PR. Apologies for that.

Wilfred commented 5 years ago

This worked well when I tested, and it's definitely a nice feature! Thank you :)

sivakov512 commented 5 years ago

@raketeneis, @Wilfred, how do i disable this feature?

shanemikel commented 5 years ago

I would also like an option to disable the feature!

Wilfred commented 5 years ago

racer-complete-insert-argument-placeholders FWIW.